Add fail2ban playbook for updating jails remotely

+ Can be used for a single host or a group of hosts
+ Update nginx-nobinary jail regex
This commit is contained in:
2021-07-21 14:48:35 +00:00
parent 909bf3278e
commit b5a97de9ff
101 changed files with 3854 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
- hosts: nginx-server
become: yes
tasks:
- name: Copy custom fail2ban filters
synchronize:
mode: push
src: fail2ban/filter.d/
dest: /etc/fail2ban/filter.d/
- name: Copy custom fail2ban jail.local
synchronize:
mode: push
src: fail2ban/jail.local
dest: /etc/fail2ban/
- name: Reload fail2ban service
ansible.builtin.service:
name: fail2ban
state: reloaded
- name: Checking status of fail2ban service after restart
command: systemctl status fail2ban
register: result
- name: Showing fail2ban status report
debug:
var: result