ansible-role-postfix/tasks/monitoring.yml

25 lines
960 B
YAML
Raw Normal View History

2023-03-20 20:01:04 +01:00
---
- name: "Monitoring | Enable Monit monitoring for Postfix"
ansible.builtin.copy:
2023-03-20 21:42:09 +01:00
src: monit/postfix
2023-03-20 20:01:04 +01:00
dest: /etc/monit/conf-enabled/postfix
mode: "0644"
notify: reload monit
when: "'monit' in ansible_facts.packages"
- name: "Monitoring | Enable Monit Monitoring for MTA-STS"
ansible.builtin.copy:
src: monit/mta-sts-daemon
dest: /etc/monit/conf-enabled/mta-sts-daemon
mode: "0644"
notify: reload monit
when: "'monit' in ansible_facts.packages and postfix_type == 'internet'"
2023-04-27 07:31:46 +02:00
- name: "Monitoring | Setup cron job for pflogsum"
ansible.builtin.cron:
name: "Daily pflogsum statistics"
job: /usr/sbin/pflogsumm --detail 8 --problems-first --no-no-msg-size --reject-detail 12 /var/log/mail.log.1 | mail -s "{{ postfix_pflogsum_mail_subject }} ({{ inventory_hostname }})" {{ postfix_pflogsum_recipient }}
hour: "{{ pflogsum_cron_hour }}"
minute: "{{ pflogsum_cron_minute }}"
when: postfix_pflogsum_enabled