Skip to content

Commit

Permalink
assume service state present by default in iptables (fix #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpool37 committed Aug 21, 2021
1 parent da5c299 commit 5b594b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/iptables.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-A INPUT -i lo -j ACCEPT

{% for service in firewall_services %}
{% if service.state != "absent" %}
{% if (service.state | default("present")) != "absent" %}
-A INPUT -m state --state NEW {% if service.protocol is defined %}{% if service.protocol == "tcp" %}-m tcp{% endif %}{% endif %} -p {{ service.protocol | default ('tcp') }} --dport {{ service.name }} -j ACCEPT
{% endif %}
{% endfor %}
Expand Down

0 comments on commit 5b594b2

Please sign in to comment.