ansible-roles/roles/offen/tasks/iptables.yml

9 lines
304 B
YAML

---
- name: Handle offen port in the firewall
iptables_raw:
name: offen_port
state: "{{ (offen_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp --dport {{ offen_port }} -s {{ offen_src_ip | join(',') }} -j ACCEPT"
tags: firewall,offen