diff --git a/evocheck/tasks/cron.yml b/evocheck/tasks/cron.yml index eb45fb2a..82f56130 100644 --- a/evocheck/tasks/cron.yml +++ b/evocheck/tasks/cron.yml @@ -1,25 +1,10 @@ --- -- name: evocheck runs normally on first day of month - cron: - cron_file: evocheck - month: "*" - weekday: "*" - day: "1" - hour: "1" - minute: "33" - user: "root" - job: "/usr/share/scripts/evocheck.sh" - state: present - -- name: evocheck runs with --cron on all other days of month - cron: - cron_file: evocheck - month: "*" - weekday: "*" - day: "2-31" - hour: "1" - minute: "33" - user: "root" - job: "/usr/share/scripts/evocheck.sh --cron" - state: present +- name: evocheck crontab is updated + template: + src: crontab.j2 + dest: /etc/cron.d/evocheck + mode: "0644" + owner: root + group: root + force: yes diff --git a/evocheck/templates/crontab.j2 b/evocheck/templates/crontab.j2 new file mode 100644 index 00000000..fdd07649 --- /dev/null +++ b/evocheck/templates/crontab.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} + +33 1 1 * * root /usr/share/scripts/evocheck.sh +33 1 2-31 * * root /usr/share/scripts/evocheck.sh --cron