2015-05-28 11:32:57 +02:00
|
|
|
---
|
|
|
|
- name: Start the iptables service
|
2015-07-13 14:17:42 +02:00
|
|
|
service: name=iptables-persistent state=restarted enabled=yes
|
|
|
|
notify: Restart fail2ban
|
|
|
|
|
|
|
|
- name: Start the netfilter service
|
|
|
|
service: name=netfilter-persistent state=restarted enabled=yes
|
|
|
|
when: is_debian8
|
2015-05-28 11:32:57 +02:00
|
|
|
notify: Restart fail2ban
|
|
|
|
|
|
|
|
- name: Flush the iptables rules
|
|
|
|
command: /etc/init.d/iptables-persistent flush
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Start the iptables service on Ubuntu < 12.04
|
|
|
|
command: /etc/init.d/iptables-persistent start
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Stop the iptables service on Ubuntu < 12.04
|
|
|
|
command: /etc/init.d/iptables-persistent stop
|
|
|
|
ignore_errors: true
|
|
|
|
|
2018-03-19 18:53:55 +01:00
|
|
|
- name: Restart fail2ban after an iptables restart
|
|
|
|
service: name=fail2ban state=restarted enabled=yes
|
|
|
|
when: has_fail2ban
|