iptables/tasks/install.yml
2021-09-19 00:21:56 +05:00

30 lines
698 B
YAML

---
- name: Install iptables-persistent
apt:
name: iptables-persistent
- name: Create directory for iptables configuration
file:
state: directory
path: '{{ iptables__conf_dir }}'
mode: 'u=rwx,go=rx'
owner: root
group: root
- name: Install iptables rules for IPv4
notify: iptables | Load iptables rules for IPv4
template:
src: templates/rules.v4
dest: '{{ iptables__conf_ipv4 }}'
mode: 'u=rw,go=r'
owner: root
group: root
- name: Install iptables rules for IPv6
notify: iptables | Load iptables rules for IPv6
template:
src: templates/rules.v6
dest: '{{ iptables__conf_ipv6 }}'
mode: 'u=rw,go=r'
owner: root
group: root