From f65e12037d94535a27b4d0635d1254fa12b19f18 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Tue, 13 Dec 2022 20:15:59 +0000 Subject: [PATCH] iptables: Fix deprecation warnings --- roles/iptables/templates/ip6tables.j2 | 4 ++-- roles/iptables/templates/iptables.j2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/roles/iptables/templates/ip6tables.j2 b/roles/iptables/templates/ip6tables.j2 index 1cd83c5..34fc4a7 100644 --- a/roles/iptables/templates/ip6tables.j2 +++ b/roles/iptables/templates/ip6tables.j2 @@ -13,10 +13,10 @@ {% 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 %} -A INPUT -m state --state NEW -m {{ rule.proto }} -p {{ rule.proto }} -s {{ from }} --dport {{ rule.port }} -j ACCEPT {% endif %} {% endfor %} diff --git a/roles/iptables/templates/iptables.j2 b/roles/iptables/templates/iptables.j2 index 3067542..df705d9 100644 --- a/roles/iptables/templates/iptables.j2 +++ b/roles/iptables/templates/iptables.j2 @@ -13,10 +13,10 @@ {% 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 %} -A INPUT -m state --state NEW -m {{ rule.proto }} -p {{ rule.proto }} -s {{ from }} --dport {{ rule.port }} -j ACCEPT {% endif %} {% endfor %}