17 lines
381 B
Bash
17 lines
381 B
Bash
#!/bin/bash
|
|
export RUNNING="/dev/shm/ansible_is_running"
|
|
|
|
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
|