nftables: Fix deprecation warnings

This commit is contained in:
Timo Makinen 2022-12-13 20:12:45 +00:00
parent 3a76cd0c87
commit 354b5b293c

View file

@ -11,10 +11,10 @@ table ip filter {
{% for rule in firewall_in %}
{% if rule.from is defined %}
{% for from in rule.from %}
{% if not from | ipv4 and not from | ipv6 %}
{% if not from | ansible.utils.ipv4 and not from | ansible.utils.ipv6 %}
{% set from = lookup('dig', from) %}
{% endif %}
{% if from | ipv4 %}
{% if from | ansible.utils.ipv4 %}
ip saddr {{ from }} {{ rule.proto }} dport {{ rule.port }} accept
{% endif %}
{% endfor %}
@ -38,10 +38,10 @@ table ip6 filter {
{% for rule in firewall_in %}
{% if rule.from is defined %}
{% for from in rule.from %}
{% if not from | ipv4 and not from | ipv6 %}
{% if not from | ansible.utils.ipv4 and not from | ansible.utils.ipv6 %}
{% set from = lookup('dig', from) %}
{% endif %}
{% if from | ipv6 %}
{% if from | ansible.utils.ipv6 %}
ip6 saddr {{ from }} {{ rule.proto }} dport {{ rule.port }} accept
{% endif %}
{% endfor %}