ansible-roles/evocheck/tasks/cron.yml

21 lines
474 B
YAML
Raw Permalink Normal View History

---
- name: Check if cron is installed
ansible.builtin.shell:
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
executable: /bin/bash
failed_when: False
changed_when: False
check_mode: no
register: is_cron_installed
2018-08-18 09:59:26 +02:00
- name: evocheck crontab is updated
ansible.builtin.template:
2018-08-18 09:59:26 +02:00
src: crontab.j2
dest: /etc/cron.d/evocheck
mode: "0644"
owner: root
group: root
2023-06-28 13:22:59 +02:00
force: true
when: is_cron_installed.rc == 0