From 4248d156bfc4c09850b817c2c0fc11e774362f5e Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 20 Jul 2025 19:01:19 +0200 Subject: [PATCH] Add fail2ban.yml --- fail2ban.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 fail2ban.yml diff --git a/fail2ban.yml b/fail2ban.yml new file mode 100644 index 0000000..da462d4 --- /dev/null +++ b/fail2ban.yml @@ -0,0 +1,24 @@ +--- +- name: Install and configure Fail2Ban + hosts: all + become: yes + tasks: + - name: Install fail2ban + apt: + name: fail2ban + state: present + update_cache: yes + + - name: Deploy jail.local + copy: + src: files/jail.local + dest: /etc/fail2ban/jail.local + owner: root + group: root + mode: '0644' + + - name: Restart fail2ban + service: + name: fail2ban + state: restarted + enabled: yes \ No newline at end of file