setup, remove lock file if we have verified there are no other runs.

This commit is contained in:
me
2026-09-29 10:23:45 -07:00
parent 6285f02214
commit 7fe9f650a6
+4
View File
@@ -211,9 +211,13 @@ fi
echo "Verifying this is the only run..." echo "Verifying this is the only run..."
ps -ef | grep ansible-playbook | grep -v grep ps -ef | grep ansible-playbook | grep -v grep
ansible_exists="$?" ansible_exists="$?"
lock_file=/tmp/ansible-playbook.lock
if [[ "$ansible_exists" == 0 ]]; then if [[ "$ansible_exists" == 0 ]]; then
echo "Playbook is already being executed. Exiting." echo "Playbook is already being executed. Exiting."
exit 0 exit 0
elif [[ -e $lock_file ]]; then
echo "Playbook not being executed. Removing lock file."
sudo mv -v "$lock_file" "${lock_file}.diaabled"
fi fi
echo "- Verified!" echo "- Verified!"