Add fail2ban.yml
This commit is contained in:
24
fail2ban.yml
Normal file
24
fail2ban.yml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user