2017-11-14 11:07:06 +01:00
|
|
|
---
|
|
|
|
|
2019-10-21 15:25:00 +02:00
|
|
|
- name: Check if cron is installed
|
2021-06-28 15:39:04 +02:00
|
|
|
shell: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
2021-05-18 14:04:54 +02:00
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
|
|
|
check_mode: no
|
2019-10-21 15:25:00 +02:00
|
|
|
failed_when: False
|
|
|
|
changed_when: False
|
|
|
|
register: is_cron_installed
|
|
|
|
|
2017-11-14 11:07:06 +01:00
|
|
|
- name: "log rotation script"
|
|
|
|
template:
|
|
|
|
src: rotate_elasticsearch_logs.j2
|
|
|
|
dest: /etc/cron.daily/rotate_elasticsearch_logs
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: "0750"
|
2019-10-21 15:25:00 +02:00
|
|
|
when: is_cron_installed.rc == 0
|