Fix zuul reboot playbook flock location

We were using /var/run/ansible/zuul_reboot.lock to flock around this
cron job. Unfortauntely it seems /var/run/ansible does not exist so the
flock command fails. Move the file to /var/run/zuul_reboot.lock to work
around this.

Note that we want to use /var/run since it is a tmpfs which means if the
server unexpectedly reboots we'll automatically clear the lock.

Change-Id: Ib0f4a434cbbf2152722493e80b5cc7a945c1f235
This commit is contained in:
Clark Boylan 2022-06-27 09:03:50 -07:00
parent aedd023738
commit f981042733
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@
minute: 1
hour: 0
weekday: 6
job: "flock -n /var/run/ansible/zuul_reboot.lock /usr/local/bin/ansible-playbook -f 20 /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul_reboot.yaml > /var/log/ansible/zuul_reboot.log 2>&1"
job: "flock -n /var/run/zuul_reboot.lock /usr/local/bin/ansible-playbook -f 20 /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul_reboot.yaml > /var/log/ansible/zuul_reboot.log 2>&1"
- name: Rotate Zuul restart logs
include_role:

View File

@ -1,4 +1,4 @@
# This relies on flock -n /var/run/ansible/zuul_reboot.lock to ensure
# This relies on flock -n /var/run/zuul_reboot.lock to ensure
# we don't run multiple copies of this playbook concurrently.
# TODO: stop pulling in the hourly job if we do this