aboutsummaryrefslogtreecommitdiff
path: root/manifests/nodo.pp
blob: 75c472b9732bcbfe6233c55d93af798bb756add0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
class nodo {
  include lsb
  include puppetd
  include backup
  include sudo
  include users::admin
  include motd
  include utils
  include cron
  include hosts
  include locales
  include tunnel

  # Set timezone and ntp config
  #
  # We config those here but leave class inclusion elsewhere
  # as ntp config differ from server to vserver.
  #
  $ntp_timezone = "Brazil/East"
  $ntp_pool     = "south-america.pool.ntp.org"
  $ntp_servers  = [ 'a.ntp.br', 'b.ntp.br', 'c.ntp.br' ]

  # Monkeysphere
  #
  # Currently we don't have a defined policy regarding whether
  # to publish all our node keys to public keyservers, so leave
  # automatic publishing disabled for now.
  #
  $monkeysphere_publish_key = false
  include monkeysphere

  # Email delivery configuration
  case $mail_delivery {
    'tunnel': {              
      tunnel::mail { "$mail_hostname":
        sshport   => "$mail_ssh_port",
      }
    }
    'postfix': { }
    '','exim',default: { include exim }
  }

  # Apt configuration
  if $use_apt != false {
    $backports_enabled = true
    $apt_update_method = 'cron'
    include apt
  }

  # Default SSH configuration
  $sshd_password_authentication = "yes"
  $sshd_shared_ip               = "yes"
  $sshd_tcp_forwarding          = "yes"

  file { "/etc/hostname":
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => present,
    content => "$fqdn\n",
  }

  file { "/etc/rc.local":
    source  => "puppet://$server/modules/nodo/etc/rc.local",
    owner   => "root",
    group   => "root",
    mode    => 0755,
    ensure  => present,
  }

  file { "/etc/screenrc":
    source  => "puppet://$server/modules/nodo/etc/screenrc",
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => present,
  }

  file { "/etc/profile":
    source  => "puppet://$server/modules/nodo/etc/profile",
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => present,
    require => File['/usr/local/bin/prompt.sh'],
  }

  file { "/etc/bash.bashrc":
    source  => "puppet://$server/modules/nodo/etc/bash.bashrc",
    owner   => "root",
    group   => "root",
    mode    => 0644,
    ensure  => present,
    require => File['/usr/local/bin/prompt.sh'],
  }

  file { "/usr/local/bin/prompt.sh":
    source  => "puppet://$server/modules/nodo/bin/prompt.sh",
    owner   => "root",
    group   => "root",
    mode    => 0755,
    ensure  => present,
  }
}