forked from thunix/ansible
Added some sanity checking, to preclude concurrent runs
This commit is contained in:
parent
2ce55a935b
commit
91c0204682
|
@ -1,7 +1,16 @@
|
|||
#!/bin/bash
|
||||
export RUNNING="/dev/shm/ansible_is_running"
|
||||
|
||||
cd /var/thunix/ansible
|
||||
/usr/bin/git pull
|
||||
/usr/local/bin/ansible-playbook -i /var/thunix/ansible/hosts /var/thunix/ansible/site.yml -u root
|
||||
rm /dev/shm/run-ansible
|
||||
touch /dev/shm/ansible-hook-last-run
|
||||
if [ -f $RUNNING ]; then
|
||||
echo "Ansible is currently running."
|
||||
exit 1
|
||||
else
|
||||
touch $RUNNING
|
||||
cd /var/thunix/ansible
|
||||
/usr/bin/git pull
|
||||
/usr/local/bin/ansible-playbook -i /var/thunix/ansible/hosts /var/thunix/ansible/site.yml -u root
|
||||
rm /dev/shm/run-ansible
|
||||
touch /dev/shm/ansible-hook-last-run
|
||||
rm $RUNNING
|
||||
exit 0
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue