From c28b0e1c3148fa8042244dd3367b800164a8464a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 30 Jan 2015 12:01:30 -0800 Subject: [PATCH] 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 --- modules/openstack_project/manifests/puppetmaster.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openstack_project/manifests/puppetmaster.pp b/modules/openstack_project/manifests/puppetmaster.pp index 9d9c46456e..5ed3aad3bf 100644 --- a/modules/openstack_project/manifests/puppetmaster.pp +++ b/modules/openstack_project/manifests/puppetmaster.pp @@ -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', }