Add flag to disable cron for test jobs

The run_all cron running in test jobs is unawesome because it can
cause the inventory overrides we put in for the testing to get
overwritten with the real inventory. We don't want test jobs
attempting to run against real hosts.

Change-Id: I733f66ff24b329d193799e6063953e88dd6a35b1
This commit is contained in:
Monty Taylor 2019-03-08 21:18:20 +00:00
parent 020a022045
commit 7a18eb49e4
3 changed files with 5 additions and 1 deletions

View File

@ -4,3 +4,5 @@ update_cron_interval:
day: '*'
month: '*'
weekday: '*'
# Flag that can be set in tests to ensure cron is not run
ansible_cron_install_cron: true

View File

@ -19,9 +19,10 @@
day: "{{ update_cron_interval.day }}"
month: "{{ update_cron_interval.month }}"
weekday: "{{ update_cron_interval.weekday }}"
when: ansible_cron_install_cron
- name: Setup log rotation
include_role:
name: logrotate
vars:
logrotate_file_name: /var/log/ansible/run_all_cron.log
logrotate_file_name: /var/log/ansible/run_all_cron.log

View File

@ -59,3 +59,4 @@ clouds:
openstackzuul_arm64ci_password: password
openstackzuul_arm64ci_project_name: project
gitea_kube_key: Z2l0ZWFfazhzX2tleQ==
ansible_cron_install_cron: false