Skip to content

Commit

Permalink
Changed to native iptables module
Browse files Browse the repository at this point in the history
  • Loading branch information
Tero Ahonen committed Aug 24, 2018
1 parent 56fe35e commit 3c6cde3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions playbooks/roles/check_firewall_initialize/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
name: nc
state: present
- name: Open correct ports from iptables
iptables_raw:
name: "allow_tcp_{{item}}"
rules: "-A INPUT -p tcp -m tcp --dport {{item}} -j ACCEPT"
with_items:
- "{{firewall_ports}}"
iptables:
chain: INPUT
protocol: tcp
destination_port: "{{item}}"
jump: ACCEPT
comment: "Accept trafic to {{item}}"
- name: Start nc -l to all valid ports
shell: "nc -l {{item}} >/dev/null 2>&1 &"
async: -1
Expand Down

0 comments on commit 3c6cde3

Please sign in to comment.