mirror of
https://github.com/ThunixdotNet/ansible.git
synced 2026-01-25 05:40:17 +00:00
Ansible setscheduler added.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user