Commit 22c0ca32 authored by Joanne Hugé's avatar Joanne Hugé

playbook/upgrader: make minute and hour cron period an option

parent eb420ed4
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
register: vifib_cron register: vifib_cron
- name: Install vifib-base playbook - name: Install vifib-base playbook
shell: ansible-playbook vifib-base.yml shell: ansible-playbook vifib-base.yml --extra-vars '{"period_minute":"*/10", "period_hour":"*"}'
when: vifib_cron.rc != 0 when: vifib_cron.rc != 0
- name: Remove old cron
cron: name="Launch ors playbook every 3 hours" state=absent
- name: Install periodic cron - name: Install periodic cron
cron: name="Launch ors playbook periodically" minute="*/10" hour="*" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log' cron: name="Launch ors playbook periodically" minute="*/10" hour="*" job='cd /opt/upgrader/playbook && ansible-playbook ors.yml 2>> /opt/upgrader/latest_ors.log >> /opt/upgrader/latest_ors.log'
......
period_minute: '0'
period_hour: '*/3'
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
chdir: /opt/upgrader/playbook-tmp/ chdir: /opt/upgrader/playbook-tmp/
- name: Set Cron - name: Set Cron
cron: name="Launch Upgrader with ansible" minute="0" hour="*/3" job='rm -rf /opt/upgrader/playbook && cp -R /opt/upgrader/playbook-tmp /opt/upgrader/playbook && cd /opt/upgrader/playbook && PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log' cron: name="Launch Upgrader with ansible" minute="{{ period_minute }}" hour="{{ period_hour }}" job='rm -rf /opt/upgrader/playbook && cp -R /opt/upgrader/playbook-tmp /opt/upgrader/playbook && cd /opt/upgrader/playbook && PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin ansible-playbook upgrader-run.yml --extra-vars "upgrader_playbook={{ upgrader_playbook }} upgrade_kernel={{ upgrade_kernel | default(False) == True }}" -i hosts 2>>/opt/upgrader/latest_upgrade.log >> /opt/upgrader/latest_upgrade.log'
- cron: name="Launch Upgrader" state=absent - cron: name="Launch Upgrader" state=absent
......
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