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