From cee4cff36bd258c4bbacdcf8c1835be6ccb54789 Mon Sep 17 00:00:00 2001 From: Martin Langhoff Date: Thu, 19 Jun 2014 12:37:56 -0400 Subject: [PATCH] ppg-apply: use flock_multi only when /mnt/cluster is mounted --- ppg-apply | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ppg-apply b/ppg-apply index 5689980..efc1f39 100755 --- a/ppg-apply +++ b/ppg-apply @@ -37,12 +37,20 @@ if [ -x /etc/puppet/local-puppet-apply ]; then else puppetcmd="puppet apply --detailed-exitcodes $@" fi -# timeout at 50m, so the next hourly run has a go at it -# sleep ~30s between tries at the flock -# default 10 flocks, but will be overridden by /mnt/cluster/conf/lock/puppet -${PPG_EXEC_PATH}/flock_multi --timeout 50m --sleeptime 30 --conflict-exit-code 200 puppet 10 \ - $puppetcmd -pexit=$? + +if /bin/mountpoint -q /mnt/cluster ; then + # timeout at 50m, so the next hourly run has a go at it + # sleep ~30s between tries at the flock + # default 10 flocks, but will be overridden by /mnt/cluster/conf/lock/puppet + ${PPG_EXEC_PATH}/flock_multi --timeout 50m --sleeptime 30 --conflict-exit-code 200 puppet 10 \ + $puppetcmd + pexit=$? +else + # some hosts don't have /mnt/cluster + # some need puppet to set it up first + $puppetcmd + pexit=$? +fi # From http://docs.puppetlabs.com/man/apply.html # 0 means ?? (guess: no changes) -- 2.11.4.GIT