2020-10-16 19:08:49 +01:00
|
|
|
- name: fail2ban filter
|
|
|
|
template:
|
2021-08-22 22:34:27 +01:00
|
|
|
src: files/nginx-fail2ban-filter.conf
|
|
|
|
dest: /etc/fail2ban/filter.d/nginx-tcp.conf
|
2020-10-24 12:10:54 +01:00
|
|
|
mode: "0600"
|
2020-10-16 19:08:49 +01:00
|
|
|
register: fail2ban_filter
|
|
|
|
|
|
|
|
- name: fail2ban jail
|
|
|
|
template:
|
2021-08-22 22:34:27 +01:00
|
|
|
src: files/nginx-fail2ban-jail.conf
|
|
|
|
dest: /etc/fail2ban/jail.d/nginx.conf
|
2020-10-24 12:10:54 +01:00
|
|
|
mode: "0600"
|
2020-10-16 19:08:49 +01:00
|
|
|
register: fail2ban_jail
|
|
|
|
|
|
|
|
- name: Restart fail2ban
|
|
|
|
service:
|
2020-10-16 19:16:04 +01:00
|
|
|
name: fail2ban
|
2020-10-16 19:08:49 +01:00
|
|
|
state: restarted
|
|
|
|
when: fail2ban_filter.changed or fail2ban_jail.changed
|