82c6dec4fa
This takes a similar approach to the extant ansible_cron_install_cron variable to disable the cron job for the cloud launcher when running under CI. If you happen to have your CI jobs when the cron job decides to fire, you end up with a harmless but confusing failed run of the cloud launcher (that has tried to contact real clouds) in the ARA results. Use the "disbaled" flag to ensure the cron job doesn't run. Using "disabled" means we can still check that the job was installed via testinfra however. Convert ansible_cron_install_cron to a similar method using disable, document the variable in the README and add a test for the run_all.sh script in crontab too. Change-Id: If4911a5fa4116130c39b5a9717d610867ada7eb1
23 lines
859 B
YAML
23 lines
859 B
YAML
- name: Ensure directory exists for lock files
|
|
file:
|
|
state: directory
|
|
path: /var/run/ansible
|
|
|
|
- name: Set up cron job for running run_cloud_launcher.sh
|
|
cron:
|
|
name: run_cloud_launcher.sh
|
|
state: present
|
|
disabled: "{{ cloud_launcher_disable_job }}"
|
|
job: '/usr/bin/flock -n /var/run/ansible/run_cloud_launcher.lock /bin/bash /opt/system-config/run_cloud_launcher.sh -c >> /var/log/ansible/run_cloud_launcher_cron.log 2>&1'
|
|
minute: "{{ cloud_launcher_cron_interval.minute }}"
|
|
hour: "{{ cloud_launcher_cron_interval.hour }}"
|
|
day: "{{ cloud_launcher_cron_interval.day }}"
|
|
month: "{{ cloud_launcher_cron_interval.month }}"
|
|
weekday: "{{ cloud_launcher_cron_interval.weekday }}"
|
|
|
|
- name: Setup log rotation
|
|
include_role:
|
|
name: logrotate
|
|
vars:
|
|
logrotate_file_name: /var/log/ansible/run_cloud_launcher_cron.log
|