Commit 310d1b18 authored by Joanne Hugé's avatar Joanne Hugé

playbook/ors: reorder vifib and ors-upgrade cron detection

parent cd485c6c
Pipeline #23735 failed with stage
in 0 seconds
---
# Delete ors-upgrade.yml cron which is replaced by 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: 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'
- name: Install reboot cron
cron: name="Launch ors playbook at reboot" special_time=reboot job='sleep 20 && cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/startup_ors.log >> /opt/upgrader/startup_ors.log'
when: ors_upgrade_cron.rc == 0
- name: Check if vifib playbook is installed
shell: 'crontab -l | grep -A1 "#Ansible: Launch Upgrader with ansible" | grep -v ors-upgrade | grep -q upgrader'
......@@ -20,6 +20,12 @@
shell: ansible-playbook vifib-base.yml
when: vifib_cron.rc != 0
- 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'
- name: Install reboot cron
cron: name="Launch ors playbook at reboot" special_time=reboot job='sleep 20 && cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/startup_ors.log >> /opt/upgrader/startup_ors.log'
- name: Get hostname
shell: hostname
......
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