ansible-role-postfix/tasks/fail2ban.yml
2023-03-20 20:01:04 +01:00

27 lines
753 B
YAML

---
- name: "Fail2ban | Copy jaiil file"
ansible.builtin.copy:
src: files/fail2ban/postfix-sasl.conf
dest: "{{ fail2ban_jail_dir }}/postfix-sasl.conf"
mode: "0644"
notify: reload fail2ban
- name: "fail2ban | Copy SASL filter"
ansible.builtin.copy:
src: files/fail2ban/postfix-sasl.local
dest: "{{ fail2ban_filter_dir }}/postfix-sasl.local"
mode: "0644"
notify: reload fail2ban
- name: "Fail2ban | Setup SASL logging"
ansible.builtin.lineinfile:
dest: /etc/rsyslog.d/postfix.conf
line: ':msg, contains, \"SASL\" /var/log/{{ mail_sasl_log }}'
notify: restart rsyslog
- name: "Fail2ban | Setup logrotate"
ansible.builtin.template:
src: mail-sasl.j2
dest: /etc/logrotate.d/mail-sasl
mode: "0644"