2019-08-22 01:52:12 +00:00
|
|
|
---
|
|
|
|
# This role deploys firewall rulesets to Ubuntu hosts
|
|
|
|
|
|
|
|
- name: Make sure iptables and netfilter-persistent are installed
|
|
|
|
apt:
|
|
|
|
name: "{{ packages }}"
|
|
|
|
state: latest
|
|
|
|
vars:
|
|
|
|
packages:
|
|
|
|
- iptables-persistent
|
|
|
|
- netfilter-persistent
|
2019-11-17 21:22:19 +00:00
|
|
|
- ipset
|
2019-08-22 01:52:12 +00:00
|
|
|
|
|
|
|
- name: Copy IPv4 ruleset
|
|
|
|
copy:
|
2019-08-22 02:00:41 +00:00
|
|
|
src: "{{ ansible_fqdn }}.rules.v4"
|
2019-08-22 01:52:12 +00:00
|
|
|
dest: /etc/iptables/rules.v4
|
2019-08-26 01:08:25 +00:00
|
|
|
notify:
|
|
|
|
- restart netfilter-persistent-v4
|
2019-08-22 01:52:12 +00:00
|
|
|
|
|
|
|
- name: Copy IPv6 ruleset
|
|
|
|
copy:
|
2019-08-22 02:00:41 +00:00
|
|
|
src: "{{ ansible_fqdn }}.rules.v6"
|
2019-08-22 01:52:12 +00:00
|
|
|
dest: /etc/iptables/rules.v6
|
2019-08-26 01:08:25 +00:00
|
|
|
notify:
|
|
|
|
- restart netfilter-persistent-v6
|