From f070a0281012512248a14faec5e679eab1b5cc1d Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 16 Nov 2019 18:04:51 +0300 Subject: [PATCH] Feat(logcheck): Send mail to `root` instead of `logcheck` Replace `SENDMAILTO="logcheck"` with `SENDMAILTO="root"`. --- playbooks/roles/logcheck/tasks/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/playbooks/roles/logcheck/tasks/main.yml b/playbooks/roles/logcheck/tasks/main.yml index 22a5e78..f6a5f2c 100644 --- a/playbooks/roles/logcheck/tasks/main.yml +++ b/playbooks/roles/logcheck/tasks/main.yml @@ -26,6 +26,21 @@ 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: -- 2.39.5