|
@@ -1,5 +1,14 @@
|
1
|
1
|
- name: Install logwatch
|
2
|
|
- apt: pkg=logwatch state=installed
|
|
2
|
+ apt: pkg={{ item }} state=installed
|
|
3
|
+ with_items:
|
|
4
|
+ - logwatch
|
|
5
|
+ - libdate-manip-perl
|
3
|
6
|
|
4
|
|
-- name: Configure logwatch to email {{ admin_email }} daily
|
5
|
|
- action: lineinfile dest=/etc/cron.daily/00logwatch regexp="^/usr/sbin/logwatch" line="/usr/sbin/logwatch --output mail --mailto {{ admin_email }} --detail high" state=present create=yes
|
|
7
|
+- name: Configure logwatch
|
|
8
|
+ template: src=etc_logwatch_conf_logwatch.conf.j2 dest=/etc/logwatch/conf/logwatch.conf
|
|
9
|
+
|
|
10
|
+- name: Remove logwatch's dist cronjob
|
|
11
|
+ file: state=absent path=/etc/cron.daily/00logwatch
|
|
12
|
+
|
|
13
|
+- name: Configure weekly logwatch cronjob
|
|
14
|
+ cron: special_time=weekly job=/usr/sbin/logwatch name=logwatch
|