evolinux: custom email for logcheck

This commit is contained in:
Jérémy Lecour 2017-03-30 15:32:59 +02:00 committed by Jérémy Lecour
parent 10b9d9e76f
commit 4eab8c319a
2 changed files with 9 additions and 0 deletions

View file

@ -6,6 +6,7 @@ general_alert_email: "root@localhost"
reboot_alert_email: Null
apt_alert_email: Null
log2mail_alert_email: Null
logcheck_alert_email: Null
raid_alert_email: Null
postfix_alias_email: Null
@ -63,6 +64,7 @@ evolinux_packages_serveur_base: True
evolinux_packages_invalid_mta: True
evolinux_packages_delete_nfs: True
evolinux_packages_listchanges: True
evolinux_packages_logcheck_recipient: True
# system

View file

@ -60,6 +60,13 @@
changed_when: not (install_server_base.stdout | search("0 upgraded") and install_server_base.stdout | search("0 newly installed"))
when: evolinux_packages_serveur_base
- name: Customize logcheck recipient
lineinfile:
dest: /etc/logcheck/logcheck.conf
regexp: '^SENDMAILTO=".*"$'
line: 'SENDMAILTO="{{ logcheck_alert_email or general_alert_email | mandatory }}"'
when: evolinux_packages_logcheck_recipient
- name: is an MTA installed?
command: "dpkg -S /usr/sbin/sendmail"
check_mode: no