]> git.phdru.name Git - ansible.git/commitdiff
Feat(logcheck): Send email to root via `/etc/aliases`
authorOleg Broytman <phd@phdru.name>
Mon, 3 Feb 2020 18:15:27 +0000 (21:15 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 3 Feb 2020 18:15:27 +0000 (21:15 +0300)
playbooks/roles/logcheck/tasks/main.yml

index db94486a3da2762faa2c3700735606c4daab11c0..5a5e2405c1df7ba4640a692cfe1f9ac334d84f9a 100644 (file)
 - name: Configure logcheck - send email to root
   become: true
   lineinfile:
-    path: /etc/logcheck/logcheck.conf
-    regexp: '^SENDMAILTO="root"$'
-    line: 'SENDMAILTO="root"'
-    insertafter: '^SENDMAILTO="logcheck"$'
-
-- name: Configure logcheck - do not send email to logcheck
-  become: true
-  lineinfile:
-    path: /etc/logcheck/logcheck.conf
-    regexp: '^SENDMAILTO="logcheck"$'
-    state: absent
+    path: /etc/aliases
+    line: 'logcheck: root'
 
 - name: Update logcheck ignore files
   become: true