Files
2026-09-03 22:11:57 +02:00

18 lines
370 B
YAML

- name: Install fail2ban
apt:
name: [fail2ban, python3-systemd]
state: present
- name: Configure sshd jail
template:
src: fail2ban/sshd.local.j2
dest: /etc/fail2ban/jail.d/sshd.local
owner: root
group: root
mode: "0644"
notify: restart fail2ban
- name: Enable fail2ban
service:
name: fail2ban
state: started
enabled: true