forked from thunix/ansible
Ansible setscheduler added.
This commit is contained in:
parent
c21c6a7f55
commit
88bb586da5
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export RUNNING="/dev/shm/ansible_is_running"
|
export RUNNING="/dev/shm/ansible_is_running"
|
||||||
export HOOK="/dev/shm/ansible-hook-last-run"
|
export HOOK="/dev/shm/ansible-hook-last-run"
|
||||||
|
export SCHED="/dev/shm/ansible_scheduler"
|
||||||
|
|
||||||
ansible_is_running()
|
ansible_is_running()
|
||||||
{
|
{
|
||||||
|
@ -9,11 +10,18 @@ ansible_is_running()
|
||||||
/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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# sets ansible scheduling
|
||||||
|
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 ]
|
||||||
ansible_is_running
|
do
|
||||||
touch $HOOK
|
rm $SCHED
|
||||||
rm $RUNNING
|
touch $RUNNING
|
||||||
|
ansible_is_running
|
||||||
|
touch $HOOK
|
||||||
|
rm $RUNNING
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue