X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=playbooks%2Froles%2Flogcheck%2Ftasks%2Fmain.yml;h=db94486a3da2762faa2c3700735606c4daab11c0;hb=7a7816e08468f05474b5cd246a945d82e15fbbfd;hp=22a5e782e8b1161dd652198dea55b02755865cfb;hpb=188faa6976df1b5ba9147282952250968180fd94;p=ansible.git diff --git a/playbooks/roles/logcheck/tasks/main.yml b/playbooks/roles/logcheck/tasks/main.yml index 22a5e78..db94486 100644 --- a/playbooks/roles/logcheck/tasks/main.yml +++ b/playbooks/roles/logcheck/tasks/main.yml @@ -26,7 +26,22 @@ line: "INTRO=0" insertafter: "^#INTRO=1$" -- name: Update logcheck ignore patterns +- 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 + +- name: Update logcheck ignore files become: true copy: src: ignore.d/