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

playbook/ors: delete ors-upgrade cron in ors playbook

parent f9490b0b
---
# ORS playbook is installed before deleting ors-upgrade cron to make sure either ors or ors-upgrade is in the cron
# ors-upgrade playbook is deprecated, use ors playbook instead
- name: Install ors playbook
shell: ansible-playbook ors.yml
# Delete ors-upgrade.yml cron which is replaced by ors.yml
- name: Delete ors-upgrade cron
cron: name="Launch Upgrader with ansible" state=absent
# Reinstall ORS playbook again since previous task deletes the vifib cron from the same name
- name: Install ors playbook again
shell: ansible-playbook ors.yml
---
- name: Check if ors-upgrade playbook is installed
shell: 'crontab -l | grep -q ors-upgrade'
ignore_errors: yes
register: ors_upgrade_cron
- name: Run ors-upgrade once so that it removes itself
shell: ansible-playbook ors-upgrade.yml
when: ors_upgrade_cron.rc == 0
# Delete ors-upgrade.yml cron which is replaced by ors.yml
- name: Delete ors-upgrade cron
cron: name="Launch Upgrader with ansible" state=absent
- name: Install periodic cron
cron: name="Launch ors playbook every 3 hours" minute="15" hour="*/3" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log'
......
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