From 3c6cde305515c16946a54f30a62bb6b56c68b542 Mon Sep 17 00:00:00 2001 From: Tero Ahonen Date: Fri, 24 Aug 2018 13:49:42 +0300 Subject: [PATCH] Changed to native iptables module --- .../roles/check_firewall_initialize/tasks/main.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/playbooks/roles/check_firewall_initialize/tasks/main.yml b/playbooks/roles/check_firewall_initialize/tasks/main.yml index a444cb4..99d6a37 100644 --- a/playbooks/roles/check_firewall_initialize/tasks/main.yml +++ b/playbooks/roles/check_firewall_initialize/tasks/main.yml @@ -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