feat: full untested ansible setup

This commit is contained in:
Twirre Meulenbelt
2026-04-22 12:22:58 +02:00
parent b1d9b2a857
commit 0d967909e7
37 changed files with 1362 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
- name: Restart fail2ban
ansible.builtin.service:
name: fail2ban
state: restarted

View File

@@ -0,0 +1,21 @@
---
- name: Install fail2ban package
ansible.builtin.apt:
name: fail2ban
state: present
update_cache: true
- name: Configure fail2ban jail.local
ansible.builtin.template:
src: jail.local.j2
dest: /etc/fail2ban/jail.local
owner: root
group: root
mode: "0644"
notify: Restart fail2ban
- name: Ensure fail2ban service is enabled
ansible.builtin.service:
name: fail2ban
state: started
enabled: true

View File

@@ -0,0 +1,9 @@
[DEFAULT]
bantime = {{ fail2ban_bantime }}
findtime = {{ fail2ban_findtime }}
maxretry = {{ fail2ban_maxretry }}
bantime.increment = true
ignoreip = {{ fail2ban_ignoreip | join(' ') }}
[sshd]
enabled = true