From 354b5b293c5bf65f89deee81b87497d3a9cbb65d Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Tue, 13 Dec 2022 20:12:45 +0000 Subject: [PATCH] nftables: Fix deprecation warnings --- roles/nftables/templates/nftables.conf.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/nftables/templates/nftables.conf.j2 b/roles/nftables/templates/nftables.conf.j2 index 164d1d4..44f153c 100644 --- a/roles/nftables/templates/nftables.conf.j2 +++ b/roles/nftables/templates/nftables.conf.j2 @@ -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 %}