--- - name: Install fail2ban ansible.builtin.apt: name: fail2ban state: present - name: Deploy Stalwart auth filter ansible.builtin.template: src: stalwart-auth.conf.j2 dest: /etc/fail2ban/filter.d/stalwart-auth.conf mode: "0644" notify: restart fail2ban - name: Deploy jail.local ansible.builtin.template: src: jail.local.j2 dest: /etc/fail2ban/jail.local mode: "0644" notify: restart fail2ban - name: Enable and start fail2ban ansible.builtin.systemd: name: fail2ban enabled: true state: started