From ba19c6e6cb59e3b9a8b3c254c22955494e6a9352 Mon Sep 17 00:00:00 2001 From: pjan Date: Sun, 16 Mar 2014 14:00:55 +0800 Subject: [PATCH] Updated cron configuration --- README.md | 1 + defaults/main.yml | 1 + meta/main.yml | 1 + tasks/main.yml | 11 +++++++++++ 4 files changed, 14 insertions(+) diff --git a/README.md b/README.md index c5c6417..56d749d 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ logwatch_detail: "low" # The level of detail in the Logwatch report logwatch_range: "yesterday" # The default time range for the Logwatch report logwatch_output: "stdout" # The output method of the Logwatch report logwatch_format: "text" # The format of the Logwatch report +logwatch_cron_time: "daily" # Cron special time specification nickname - must match with logwatch range! ``` diff --git a/defaults/main.yml b/defaults/main.yml index 66d7fdb..b4a6827 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -5,3 +5,4 @@ logwatch_detail: "low" # The level of detail in the Logwatch report logwatch_range: "yesterday" # The default time range for the Logwatch report logwatch_output: "stdout" # The output method of the Logwatch report logwatch_format: "text" # The format of the Logwatch report +logwatch_cron_time: "daily" # Cron special time specification nickname - must match with logwatch range! diff --git a/meta/main.yml b/meta/main.yml index 09219c5..fd99a4e 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -16,3 +16,4 @@ galaxy_info: dependencies: - Ansibles.perl + - Ansibles.cron diff --git a/tasks/main.yml b/tasks/main.yml index 82efaa2..62d3f7f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -14,3 +14,14 @@ owner: root group: root mode: 0644 + +- name: Logwatch | Remove logwatch's cronjob + file: + path: /etc/cron.daily/00logwatch + state: absent + +- name: Logwatch | Configure logwatch's cronjob + cron: + name: logwatch + job: /usr/sbin/logwatch + special_time: "{{logwatch_cron_time}}"