resist-vpn-infra/roles/system_hardening/tasks/fail2ban.yml
2026-01-26 21:22:41 -05:00

23 lines
458 B
YAML

---
# Fail2ban Configuration Tasks
- name: Ensure fail2ban is installed
ansible.builtin.apt:
name: fail2ban
state: present
- name: Configure fail2ban
ansible.builtin.template:
src: fail2ban.local.j2
dest: /etc/fail2ban/jail.local
owner: root
group: root
mode: '0644'
notify: restart fail2ban
- name: Ensure fail2ban is started and enabled
ansible.builtin.systemd:
name: fail2ban
state: started
enabled: yes