From 45c99882a470b33edf4789e67aca610ecd3eeda7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 24 Jan 2013 15:16:28 -0200 Subject: Adding puppet::master::update --- files/post-update.sh | 20 ++++++++++++++++++++ files/update-puppet-conf.sh | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 files/post-update.sh (limited to 'files') diff --git a/files/post-update.sh b/files/post-update.sh new file mode 100644 index 0000000..21030b1 --- /dev/null +++ b/files/post-update.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# See https://we.riseup.net/riseup+tech/puppet + +echo "" +echo "Updating puppet configuration..." +echo "" + +unset GIT_DIR + +cd $PUPPET_DIR + +# lockfile comes from procmail package +lockfile ~/puppet.lock + +# call external SUID script that will update PUPPET_DIR +sudo -u puppet /usr/local/sbin/update-puppet-conf.sh \ + || echo "Updating puppet failed. Fix it manually." + +# remove lock +rm -f ~/puppet.lock diff --git a/files/update-puppet-conf.sh b/files/update-puppet-conf.sh index b299950..1eaae46 100644 --- a/files/update-puppet-conf.sh +++ b/files/update-puppet-conf.sh @@ -3,7 +3,7 @@ # 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. +# script it intended to be called from a cron-job or by a post-update hook. PUPPET_DIR=/etc/puppet ORIGIN_DIR=/var/git/repositories/puppet.git -- cgit v1.2.3