iptables: Fix deprecation warnings

This commit is contained in:
Timo Makinen 2022-12-13 20:15:59 +00:00
parent 354b5b293c
commit f65e12037d
2 changed files with 4 additions and 4 deletions

View file

@ -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 %}

View file

@ -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 %}