aboutsummaryrefslogtreecommitdiff
path: root/manifests/role/master.pp
blob: 76bdf296e070d1d0fc1d6b4aebe3c71092465894 (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
class nodo::role::master {
  $main        = hiera('nodo::role::master::main',        false)
  $db_password = hiera('nodo::role::master::db_password', '')

  case $db_password {
    '': { fail("Please set nodo::master::db_password in your config") }
  }

  if $main == true {
    # Puppetmaster should be included before nodo::virtual
    class { 'puppet::master':
      main => true,
    }

    include munin::host
    include munin::plugins::muninhost

    # The main master has a host entry pointing to itself, other
    # masters still retrieve catalogs from the main master.
    #
    # For that we're relying just on DNS entries.
    host { "puppet":
      ensure       => absent,
      ip           => "127.0.0.1",
      host_aliases => ["puppet.${::domain}"],
    }
  } else {
    class { 'puppet::master':
      main => false,
    }

    host { "puppet":
      ensure => absent,
    }

    # Quick and dirty way to keep munin disabled
    package { 'munin':
      ensure => purged,
    }
  }

  # These should be included after puppetmaster
  include nodo::role::virtual
  include database
  include git::daemon
  include nagios::headless
  include nagios::defaults
  include nodo::subsystem::monitor::master

  # Nagios apache workaround
  file { "/etc/apache2/conf.d/nagios3.conf":
    ensure => absent,
  }

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

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

  # Check domain registration
  domain_check::instance { $::domain: }
}