Improved firewall loop

This commit is contained in:
Alex 2020-04-14 22:51:57 +02:00
parent 4a229a4dc3
commit e397c0d0d2
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
1 changed files with 15 additions and 32 deletions

View File

@ -18,10 +18,12 @@
tags: tags:
- setup - setup
- packages - packages
- name: Allow Unbound TCP through iptables - name: Allow Unbound through iptables
loop: loop:
- ipv4 - { ipv: 'ipv4', proto: 'tcp' }
- ipv6 - { ipv: 'ipv6', proto: 'tcp' }
- { ipv: 'ipv4', proto: 'udp' }
- { ipv: 'ipv6', proto: 'udp' }
iptables: iptables:
chain: INPUT chain: INPUT
ctstate: ctstate:
@ -30,27 +32,8 @@
- RELATED - RELATED
destination_port: "53" destination_port: "53"
jump: ACCEPT jump: ACCEPT
ip_version: '{{ item }}' ip_version: '{{ item.ipv }}'
protocol: tcp protocol: '{{ item.proto }}'
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
notify: notify:
- Save netfilter rules - Save netfilter rules
tags: tags: