tokenbridge/deployment/roles/monitor/tasks/cron.yml
Przemyslaw Rzad 9c8259700b
Add cron schedule to monitor deployment playbook (#161)
* Default cron schedule

* Added cron task

* Docs

* Overwriting log files

* Removed deprecated flag

* Default monitor_cron_schedule.
2019-07-26 15:59:30 +02:00

19 lines
641 B
YAML

---
- name: Parse cron schedule
set_fact:
minute: "{{ monitor_cron_schedule.split(' ')[0] }}"
hour: "{{ monitor_cron_schedule.split(' ')[1] }}"
day: "{{ monitor_cron_schedule.split(' ')[2] }}"
month: "{{ monitor_cron_schedule.split(' ')[3] }}"
weekday: "{{ monitor_cron_schedule.split(' ')[4] }}"
job: "/bin/bash -c 'cd {{ bridge_path }}/monitor/scripts; ./checkDocker.sh >cronWorker.out 2>cronWorker.err'"
- name: Add cron entry
cron:
name: "RUN_MONITOR_CHECKS"
minute: "{{ minute }}"
hour: "{{ hour }}"
day: "{{ day }}"
month: "{{ month }}"
weekday: "{{ weekday }}"
job: "{{ job }}"