aboutsummaryrefslogtreecommitdiff
path: root/manifests/master.pp
blob: e6d7722b719f3cff8c76fac1fc85d7f52322cd5e (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
class nodo::master {
  case $main_master {
    '': { fail("You need to define if this is the main master! Please set \$main_master in host config") }
  }

  # Puppetmaster should be included before nodo::vserver
  if $main_master == true {
    include puppetmasterd
    include munin::host

    # The main master has a host entry pointing to itself, other
    # masters still retrieve catalogs from the main master.
    host { "puppet":
      ensure => present,
      ip     => "127.0.0.1",
      alias  => ["puppet.$domain"],
    }
  } else {
    include puppetmasterd::disabled
    host { "puppet":
      ensure => absent,
    }
  }

  # These should be included after puppetmaster
  include nodo::vserver
  include database
  include gitosis
  include websites::admin

  case $puppetmaster_db_password {
    '': { fail("Please set \$puppetmaster_db_password in your host config") }
  }

  # update master's puppet.conf if you change here
  database::instance { "puppet":
    password => "$puppetmaster_db_password",
  }

  backupninja::mysql { "all_databases":
  	backupdir => '/var/backups/mysql',
  	compress  => true,
  	sqldump   => true,
  }

  # used for trac dependency graphs
  package { "graphviz":
    ensure => present,
  }
}