Only touch and remove it once
This commit is contained in:
parent
8d525a726f
commit
19ced42e6b
|
@ -5,11 +5,9 @@ export SCHED="/dev/shm/ansible_scheduler"
|
||||||
|
|
||||||
ansible_is_running()
|
ansible_is_running()
|
||||||
{
|
{
|
||||||
touch $RUNNING
|
|
||||||
cd /var/thunix/ansible
|
cd /var/thunix/ansible
|
||||||
/usr/bin/git pull
|
/usr/bin/git pull
|
||||||
/usr/local/bin/ansible-playbook -i /var/thunix/ansible/hosts /var/thunix/ansible/site.yml -u root
|
/usr/local/bin/ansible-playbook -i /var/thunix/ansible/hosts /var/thunix/ansible/site.yml -u root
|
||||||
rm $RUNNING
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# sets ansible scheduling
|
# sets ansible scheduling
|
||||||
|
@ -18,10 +16,12 @@ touch $SCHED
|
||||||
if [ -f $RUNNING ]; then
|
if [ -f $RUNNING ]; then
|
||||||
echo "Ansible is currently running."
|
echo "Ansible is currently running."
|
||||||
else
|
else
|
||||||
|
touch $RUNNING
|
||||||
while [ -f $SCHED ]
|
while [ -f $SCHED ]
|
||||||
do
|
do
|
||||||
rm $SCHED
|
rm $SCHED
|
||||||
ansible_is_running
|
ansible_is_running
|
||||||
touch $HOOK
|
touch $HOOK
|
||||||
done
|
done
|
||||||
|
rm $RUNNING
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue