Commit e96ae8e9 authored by Joanne Hugé's avatar Joanne Hugé

playbook: prevent ORS playbook from entering an infinite loop

parent 1a01c455
......@@ -7,10 +7,18 @@
register: anacron_present
ignore_errors: yes
- name: Prevent ORS playbook from recursively running
file: path="/opt/upgrader/ors_playbook_rerun" state="touch"
when: anacron_present.rc != 0
- name: Check if ors_playbook_rerun exists
stat: path="/opt/upgrader/ors_playbook_rerun"
register: ors_playbook_rerun
- name: Run ORS playbook in case anacron is not installed
shell: ansible-playbook ors.yml -i hosts 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log
ignore_errors: yes
when: anacron_present.rc != 0
when: (anacron_present.rc != 0) and (ors_playbook_rerun.stat.exists == false)
args:
chdir: /opt/upgrader/playbook-tmp/
......
1a521af09daa0c44f0a03347c771a79871693df4f40902fe912469bd8af004f6 -
d8d83472b5d13d54e1d2db757e7e054b26a156e49ac569927d00117f5ad8c959 -
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment