tokenbridge/deployment/roles/monitor/tasks/cron.yml
2020-01-10 15:55:34 +03:00

19 lines
644 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; ./getBridgeStats.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 }}"