2015-08-23 11:06:25 +02:00
|
|
|
---
|
|
|
|
- name: Install iptables-persistent
|
|
|
|
when: ansible_distribution_version == '14.04'
|
2016-08-25 11:58:15 +02:00
|
|
|
apt: pkg=iptables-persistent update_cache=yes
|
2016-08-14 15:33:48 +02:00
|
|
|
tags: packages
|
2015-08-23 11:06:25 +02:00
|
|
|
|
|
|
|
- name: Copy /etc/iptables/rules.v4
|
|
|
|
when: ansible_distribution_version == '14.04'
|
|
|
|
template: src=iptables.j2 dest=/etc/iptables/rules.v4 owner=root mode=0600
|
|
|
|
notify:
|
|
|
|
- restart iptables-persistent
|
|
|
|
|
|
|
|
- name: Copy /etc/iptables/rules.v6
|
|
|
|
when: ansible_distribution_version == '14.04'
|
|
|
|
template: src=ip6tables.j2 dest=/etc/iptables/rules.v6 owner=root group=root mode=0600
|
|
|
|
notify:
|
|
|
|
- restart iptables-persistent
|
|
|
|
|
|
|
|
- name: Install firewalld and deps
|
2016-04-14 19:57:18 +02:00
|
|
|
when: ansible_distribution_version >= '15.04'
|
2015-08-23 11:06:25 +02:00
|
|
|
apt: pkg={{ item }} state=latest
|
|
|
|
with_items:
|
|
|
|
- firewalld
|
|
|
|
- tidy
|
2016-08-14 15:33:48 +02:00
|
|
|
tags: packages
|
2015-08-23 11:06:25 +02:00
|
|
|
|
|
|
|
- name: Copy firewalld public zone file
|
2016-04-14 19:57:18 +02:00
|
|
|
when: ansible_distribution_version >= '15.04'
|
2015-08-23 11:06:25 +02:00
|
|
|
template: src=public.xml.j2 dest=/etc/firewalld/zones/public.xml owner=root mode=0600
|
|
|
|
|
|
|
|
- name: Format public.xml firewalld zone file
|
2016-04-14 19:57:18 +02:00
|
|
|
when: ansible_distribution_version >= '15.04'
|
2015-08-23 11:06:25 +02:00
|
|
|
shell: tidy -xml -iq -m -w 0 /etc/firewalld/zones/public.xml
|
|
|
|
notify:
|
|
|
|
- restart firewalld
|