From cf5439cf73fb73839c4dbf0fd4ee0c19553e2490 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 11 Aug 2026 14:35:42 -0700 Subject: [PATCH] setup.sh, ensure only one instance of ansible-playbook runs at a time. --- setup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/setup.sh b/setup.sh index ee59d97..9c471c7 100755 --- a/setup.sh +++ b/setup.sh @@ -208,6 +208,14 @@ if [[ -n "$create_server" && ! -f "$server_config" ]]; then ls -lh "$server_config" 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..." if [[ $local == "Y" ]]; then sudo ansible-playbook $LOCAL