From e9ca0bc9adc9c3226bac63507206d328f60a0d3f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 15 Mar 2019 09:36:56 +1100 Subject: [PATCH] Ensure lockfile dir is created for bridge.o.o After we reboot the lockfile directory disappears. Recreate it before running the puppet that would create it anyway. Change-Id: Ia0779240b9e516090237dfbe61404fab114c6d4a --- playbooks/roles/ansible-cron/tasks/main.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/ansible-cron/tasks/main.yaml b/playbooks/roles/ansible-cron/tasks/main.yaml index f3724c815d..9e1735c49b 100644 --- a/playbooks/roles/ansible-cron/tasks/main.yaml +++ b/playbooks/roles/ansible-cron/tasks/main.yaml @@ -13,7 +13,9 @@ cron: name: run_all.sh state: present - job: 'flock -n /var/run/ansible/run_all.lock bash /opt/system-config/run_all.sh -c >> /var/log/ansible/run_all_cron.log 2>&1' + # Note /var/run is ephemeral; so after a reboot we need to + # ensure the lockfile dir is there before we run... + job: 'mkdir -p /var/run/ansible; flock -n /var/run/ansible/run_all.lock bash /opt/system-config/run_all.sh -c >> /var/log/ansible/run_all_cron.log 2>&1' minute: "{{ update_cron_interval.minute }}" hour: "{{ update_cron_interval.hour }}" day: "{{ update_cron_interval.day }}"