]> git.phdru.name Git - ansible.git/commitdiff
Feat(logcheck): Send mail to `root` instead of `logcheck`
authorOleg Broytman <phd@phdru.name>
Sat, 16 Nov 2019 15:04:51 +0000 (18:04 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 18 Nov 2019 11:40:33 +0000 (14:40 +0300)
Replace `SENDMAILTO="logcheck"` with `SENDMAILTO="root"`.

playbooks/roles/logcheck/tasks/main.yml

index 22a5e782e8b1161dd652198dea55b02755865cfb..f6a5f2c6b3197acc0c0275c06faf72e0888cb041 100644 (file)
     line: "INTRO=0"
     insertafter: "^#INTRO=1$"
 
+- name: Configure logcheck - send to root
+  become: true
+  lineinfile:
+    path: /etc/logcheck/logcheck.conf
+    regexp: '^SENDMAILTO="root"$'
+    line: 'SENDMAILTO="root"'
+    insertafter: '^SENDMAILTO="logcheck"$'
+
+- name: Configure logcheck - not send to logcheck
+  become: true
+  lineinfile:
+    path: /etc/logcheck/logcheck.conf
+    regexp: '^SENDMAILTO="logcheck"$'
+    state: absent
+
 - name: Update logcheck ignore patterns
   become: true
   copy: