Add Out of memory log2mail alert to dovecot role

This commit is contained in:
William Hirigoyen (Evolix) 2022-03-02 11:07:14 +01:00
parent ab1f3fd6d4
commit a565e8f8e8
2 changed files with 27 additions and 0 deletions

View File

@ -8,3 +8,9 @@
service:
name: dovecot
state: reloaded
- name: restart log2mail
service:
name: log2mail
state: restarted

View File

@ -82,3 +82,24 @@
tags:
- dovecot
- name: log2mail is installed
apt:
name: log2mail
state: present
tags: dovecot
- name: dovecot is configured in log2mail
blockinfile:
path: /etc/log2mail/config/mail.conf
create: true
owner: log2mail
group: adm
mode: "0640"
block: |
file = /var/log/mail.log
pattern = "Out of memory"
mailto = {{ log2mail_alert_email or general_alert_email | mandatory }}
template = /etc/log2mail/mail
notify: restart log2mail
tags: dovecot