diff options
Diffstat (limited to 'files')
| -rw-r--r-- | files/check-puppetd.sh | 16 | ||||
| -rw-r--r-- | files/update-puppet-conf.sh | 21 |
2 files changed, 37 insertions, 0 deletions
diff --git a/files/check-puppetd.sh b/files/check-puppetd.sh new file mode 100644 index 0000000..fbf6988 --- /dev/null +++ b/files/check-puppetd.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# +# check if puppet is running +# + +PID="/var/run/puppet/puppetd.pid" +INIT="/etc/init.d/puppet" + +if [ ! -f "$PID" ]; then + $INIT start +else + running="$(ps $(cat $PID) &> /dev/null)" + if [ "$?" != "0" ]; then + $INIT start + fi +fi diff --git a/files/update-puppet-conf.sh b/files/update-puppet-conf.sh new file mode 100644 index 0000000..e850c47 --- /dev/null +++ b/files/update-puppet-conf.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# This file updates the /etc/puppet directory with recent changes to the +# /var/git/repositories/puppet repository and changes to other remote +# repositories configured as submodules of this puppet installation. This +# script it intended to be called from a cron-job. + +PUPPET_DIR=/etc/puppet +ORIGIN_DIR=/var/git/repositories/puppet.git + +unset GIT_DIR + +cd ${PUPPET_DIR} +git pull ${ORIGIN_DIR} master +git checkout -f +git submodule update --init +for module in `git submodule | cut -d" " -f3`; do + cd ${PUPPET_DIR}/${module} + git pull origin master +done +git clean -d -f |
