Improved firewall loop
This commit is contained in:
parent
4a229a4dc3
commit
e397c0d0d2
|
@ -18,10 +18,12 @@
|
|||
tags:
|
||||
- setup
|
||||
- packages
|
||||
- name: Allow Unbound TCP through iptables
|
||||
- name: Allow Unbound through iptables
|
||||
loop:
|
||||
- ipv4
|
||||
- ipv6
|
||||
- { ipv: 'ipv4', proto: 'tcp' }
|
||||
- { ipv: 'ipv6', proto: 'tcp' }
|
||||
- { ipv: 'ipv4', proto: 'udp' }
|
||||
- { ipv: 'ipv6', proto: 'udp' }
|
||||
iptables:
|
||||
chain: INPUT
|
||||
ctstate:
|
||||
|
@ -30,27 +32,8 @@
|
|||
- RELATED
|
||||
destination_port: "53"
|
||||
jump: ACCEPT
|
||||
ip_version: '{{ item }}'
|
||||
protocol: tcp
|
||||
notify:
|
||||
- Save netfilter rules
|
||||
tags:
|
||||
- update
|
||||
- firewall
|
||||
- name: Allow Unbound UDP through iptables
|
||||
loop:
|
||||
- ipv4
|
||||
- ipv6
|
||||
iptables:
|
||||
chain: INPUT
|
||||
ctstate:
|
||||
- NEW
|
||||
- ESTABLISHED
|
||||
- RELATED
|
||||
destination_port: "53"
|
||||
jump: ACCEPT
|
||||
ip_version: '{{ item }}'
|
||||
protocol: udp
|
||||
ip_version: '{{ item.ipv }}'
|
||||
protocol: '{{ item.proto }}'
|
||||
notify:
|
||||
- Save netfilter rules
|
||||
tags:
|
||||
|
|
Reference in New Issue