Skip to content
Commits on Source (2)
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
dest: "/etc/fail2ban/filter.d/{{item}}.conf" dest: "/etc/fail2ban/filter.d/{{item}}.conf"
with_items: with_items:
- nginx-proxy - nginx-proxy
when: rev_proxy == "nginx"
notify: notify:
- restart fail2ban - restart fail2ban
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
dest: "/etc/fail2ban/jail.d/{{item}}.conf" dest: "/etc/fail2ban/jail.d/{{item}}.conf"
with_items: with_items:
- nginx-proxy - nginx-proxy
when: rev_proxy == "nginx"
notify: notify:
- restart fail2ban - restart fail2ban
......
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
src: "../templates/nginx-proxy-filter.conf.j2" src: "../templates/nginx-proxy-filter.conf.j2"
dest: "/etc/fail2ban/filter.d/nginx-proxy.conf" dest: "/etc/fail2ban/filter.d/nginx-proxy.conf"
notify: restart fail2ban notify: restart fail2ban
when: rev_proxy == "nginx"
- name: Setup jail - name: Setup jail
template: template:
src: "../templates/nginx-proxy-jail.conf.j2" src: "../templates/nginx-proxy-jail.conf.j2"
dest: "/etc/fail2ban/jail.d/nginx-proxy.conf" dest: "/etc/fail2ban/jail.d/nginx-proxy.conf"
notify: restart fail2ban notify: restart fail2ban
\ No newline at end of file when: rev_proxy == "nginx"
\ No newline at end of file