setup.sh, ensure only one instance of ansible-playbook runs at a time.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user