Use flock around puppet_run_all script

The ansible triggered puppet runs in the puppet_run_all script can force
the script to take longer than 15 minutes if there is much work to do.
This means puppet runs can overlap since the cron executes every 15
minutes. Avoid this overlap if things take a long time with a lock file
enforced by flock.

Change-Id: Ib2680ae3d2641dba7262d09d05a8bcd105b2bb43
This commit is contained in:
Clark Boylan 2015-01-30 12:01:30 -08:00
parent a27aef70dc
commit c28b0e1c31

View File

@ -51,7 +51,7 @@ class openstack_project::puppetmaster (
cron { 'updatepuppetmaster':
user => 'root',
minute => '*/15',
command => 'bash /opt/system-config/production/run_all.sh',
command => 'flock -n /var/run/puppet/puppet_run_all.lock bash /opt/system-config/production/run_all.sh',
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
}