- 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