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