From: Oleg Broytman Date: Sat, 16 Nov 2019 15:04:51 +0000 (+0300) Subject: Feat(logcheck): Send mail to `root` instead of `logcheck` X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=f070a0281012512248a14faec5e679eab1b5cc1d;p=ansible.git Feat(logcheck): Send mail to `root` instead of `logcheck` Replace `SENDMAILTO="logcheck"` with `SENDMAILTO="root"`. --- 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: