Making Sure Puppet is Running

1 minute read Published:

Have you ever realized that puppet stopped running on a server a month ago? Or perhaps you stopped it and forgot to restart it? Your server has been ignoring vital security updates because you thought that puppet had it covered. That’s why I use this handy bit of code:

cron { "puppet" :
    command => "/etc/init.d/puppet | grep 'stopped' > /dev/null; if [ $? -eq 1 ]; then /etc/init.d/puppet start; fi;",
    ensure  => present,
    user    => "root",
    minute  => 10,