pf: Don't set empty defaults, check if var is defined

This commit is contained in:
Timo Makinen 2021-03-19 18:35:58 +00:00
parent 5417be177a
commit 6acefc9178
2 changed files with 4 additions and 5 deletions

View file

@ -1,6 +1,3 @@
--- ---
firewall_in: firewall_in:
- {proto: tcp, port: 22} - {proto: tcp, port: 22}
firewall_raw: []

View file

@ -8,9 +8,11 @@ pass out
pass in quick proto icmp pass in quick proto icmp
pass in quick proto icmp6 pass in quick proto icmp6
{% if firewall_raw is defined %}
{% for rule in firewall_raw %} {% for rule in firewall_raw %}
{{ rule }} {{ rule }}
{% endfor %} {% endfor %}
{% endif %}
{% for rule in firewall_in %} {% for rule in firewall_in %}
{% if rule.from is defined %} {% if rule.from is defined %}
{% for from in rule.from | ipaddr %} {% for from in rule.from | ipaddr %}