23 lines
458 B
YAML
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
|