diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/check-puppetd.sh.erb | 21 | ||||
-rw-r--r-- | templates/puppet-node.conf.erb | 2 |
2 files changed, 22 insertions, 1 deletions
diff --git a/templates/check-puppetd.sh.erb b/templates/check-puppetd.sh.erb new file mode 100644 index 0000000..639a1d5 --- /dev/null +++ b/templates/check-puppetd.sh.erb @@ -0,0 +1,21 @@ +#!/bin/bash +# +# check if puppet is running +# + +PID="/var/run/puppet/<%= puppet_agent_name %>.pid" +INIT="/etc/init.d/puppet" + +function puppet_start { + sleep `echo $RANDOM/2000*60 | bc` + $INIT start +} + +if [ ! -f "$PID" ]; then + puppet_start +else + running="$(ps $(cat $PID) &> /dev/null)" + if [ "$?" != "0" ]; then + puppet_start + fi +fi diff --git a/templates/puppet-node.conf.erb b/templates/puppet-node.conf.erb index 033c2e5..f8b1b32 100644 --- a/templates/puppet-node.conf.erb +++ b/templates/puppet-node.conf.erb @@ -6,7 +6,7 @@ rundir = /var/run/puppet factpath = $vardir/lib/facter pluginsync = true -[<%= puppet_agent_section %>] +[<%= puppet_agent_name %>] vardir = /var/lib/puppet ssldir = $vardir/ssl server = puppet.<%= domain %> |