common/tasks/iptables.yml

31 lines
746 B
YAML
Raw Normal View History

2020-01-14 04:00:07 -05:00
---
- name: Install iptables-persistent
apt:
name: iptables-persistent
- name: Create directory for iptables configuration
file:
state: directory
2020-01-14 05:12:21 -05:00
path: '{{ common__iptables__conf_dir }}'
2020-01-14 04:00:07 -05:00
mode: 'u=rwx,g=rx,o=rx'
owner: root
group: root
- name: Install iptables rules for IPv4
template:
2020-01-14 06:01:49 -05:00
src: templates/iptables/rules.v4
2020-01-14 05:12:21 -05:00
dest: '{{ common__iptables__conf_ipv4 }}'
2020-01-14 04:00:07 -05:00
mode: 'u=rw,g=r,o=r'
owner: root
group: root
notify: common | Load iptables rules for IPv4
- name: Install iptables rules for IPv6
template:
2020-01-14 06:01:49 -05:00
src: templates/iptables/rules.v6
2020-01-14 05:12:21 -05:00
dest: '{{ common__iptables__conf_ipv6 }}'
2020-01-14 04:00:07 -05:00
mode: 'u=rw,g=r,o=r'
owner: root
group: root
notify: common | Load iptables rules for IPv6