class nodo::master { $main_master = hiera('nodo::master::main', false) $master_db_password = hiera('nodo::master::db_password', '') if $main_master == true { # Puppetmaster should be included before nodo::vserver 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. host { "puppet": ensure => present, ip => "127.0.0.1", alias => ["puppet.$domain"], } } else { class { 'puppet::master': main => false, } host { "puppet": ensure => absent, } } # These should be included after puppetmaster include nodo::vserver include database include git::daemon include websites::admin include nagios::headless include nagios::defaults # Nagios apache workaround file { "/etc/apache2/conf.d/nagios3.conf": ensure => absent, } # For storeconfigs include mysql::server # Database creation as suggested by # http://reductivelabs.com/trac/puppet/wiki/Recipes/MySQLStoredConfiguration #exec { "create-storeconfigs-db": # command => "/usr/bin/mysqladmin create puppet", # unless => "/usr/bin/mysqlcheck -s puppet", # notify => Exec["create-storeconfigs-user"], #} # #$cmd = "/usr/bin/mysql -e 'grant all privileges on puppet.* to puppet@localhost identified by \"puppet\"'" # #exec { "create-storeconfigs-user": # command => $cmd, # refreshonly => true, #} case $master_db_password { '': { fail("Please set nodo::master::db_password in your config") } } # 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 { $domain: } }