system-config/playbooks/roles/cloud-launcher-cron/tasks/main.yaml
Ian Wienand e32a9fdd0f run_cloud_launcher.sh : generate runtime stats
Similar to run_all.sh (I299c0ab5dc3dea4841e560d8fb95b8f3e7df89f2),
produce a runtime stat for each run of the cloud launcher.

Although it won't directly highlight errors, problems tend to end this
playbook early.  When graphed with grafana, we could have noticed a
large drop in the average runtime which would have suggested a
problem.

Change-Id: I8e5371cbc94e9a803ea5e64ae94aca293b834c73
2018-11-08 08:43:40 +11:00

22 lines
810 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
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