ansible-roles/iptables/tasks/main.yml

33 lines
884 B
YAML
Raw Normal View History

---
- name: Install the needed iptables packages
apt: pkg={{ item }} state=installed
with_items:
- iptables
- iptables-persistent
tags:
- iptables
- name: Install the IPv4 rules with a different name. Needed by Ubuntu < 12.04
template: src=iptables-{{ item }}.j2 dest=/etc/iptables/rules owner=root group=root mode=0640
with_items:
- rules.v4
when: is_ubuntu_between_10_04_and_11_04_and_is_debian_6
notify:
- Start the iptables service on Ubuntu < 12.04
tags:
- iptables
- iptables_rules
- name: Install the IPv4 and IPv6 iptables rules. The IPv6 ones are not used
template: src=iptables-{{ item }}.j2 dest=/etc/iptables/{{ item }} owner=root group=root mode=0640
with_items:
- rules.v4
- rules.v6
when: is_not_ubuntu_less_than_precise
notify:
- Start the iptables service
tags:
- iptables
- iptables_rules