# handles puppetd service class puppetd inherits puppet { package { "cron": ensure => installed, } package { "puppet": ensure => installed, require => Package["cron"], } service { "puppet": enable => true, ensure => running, hasrestart => true, require => Package["puppet"], } # default config file for puppet nodes case $puppetmasterd_present { true: { } default: { file { "/etc/puppet/puppet.conf": ensure => file, owner => puppet, group => puppet, mode => 0644, content => template("puppet/puppet-node.conf.erb"), } } } # cron rule to restart puppet minutes after puppetmaster is restarted cron { "puppet-restart": command => "/etc/init.d/puppet restart &> /dev/null", user => root, hour => "*/1", minute => "10", ensure => absent, require => Service["puppet"], } file { "/usr/local/sbin/check-puppetd.sh": source => "puppet://$server/modules/puppet/check-puppetd.sh", owner => "puppet", group => "puppet", mode => 0755, ensure => present, } cron { "puppetd-check": command => "/usr/local/sbin/check-puppetd.sh &> /dev/null", user => root, hour => "*/1", minute => "0", require => File["/usr/local/sbin/check-puppetd.sh"], ensure => present, } }