setup.sh, ensure only one instance of ansible-playbook runs at a time.

This commit is contained in:
2026-08-11 14:35:42 -07:00
parent aac6eb6374
commit cf5439cf73
+8
View File
@@ -208,6 +208,14 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then
ls -lh "$server_config" ls -lh "$server_config"
fi fi
echo "Verifying this is the only run..."
ps -ef | grep ansible-playbook | grep -v grep
ansible_exists="$?"
if [[ "$ansible_exists" == 0 ]]; then
echo "Playbook is already being executed. Exiting."
exit 0
fi
echo "Provisioning Ansible..." echo "Provisioning Ansible..."
if [[ $local == "Y" ]]; then if [[ $local == "Y" ]]; then
sudo ansible-playbook $LOCAL sudo ansible-playbook $LOCAL