ansible-role-postfix/tasks/fail2ban.yml
2023-09-23 09:05:01 +02:00

27 lines
733 B
YAML

---
- name: "Fail2ban | Copy jail 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.copy:
src: rsyslog.d/mail-sasl.conf
dest: /etc/rsyslog.d/mail-sasl.conf
mode: "0644"
notify: restart rsyslog
- name: "Fail2ban | Setup logrotate"
ansible.builtin.template:
src: mail-sasl.j2
dest: /etc/logrotate.d/mail-sasl
mode: "0644"