Use FQCN for IP utils
This commit is contained in:
		@@ -66,7 +66,7 @@
 | 
			
		||||
-A INPUT -i lo -m comment --comment "lo accept all inet6" -j ACCEPT
 | 
			
		||||
 | 
			
		||||
{% if firewall_ssh_whitelist | length %}
 | 
			
		||||
{% for ip in firewall_ssh_whitelist | ipv6 %}
 | 
			
		||||
{% for ip in firewall_ssh_whitelist | ansible.utils.ipv6 %}
 | 
			
		||||
-A INPUT -p tcp -m tcp --dport 22 --source {{ ip }} -m comment --comment "accept {{ ip }} ssh 22/tcp6" -j ACCEPT
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 
 | 
			
		||||
@@ -9,8 +9,8 @@ add {{ name }} {{ ip_or_net }}
 | 
			
		||||
{% endmacro %}
 | 
			
		||||
 | 
			
		||||
{% macro render_dual_stack_ipset(ipset, name, type="hash:net", family="inet", timeout=None) %}
 | 
			
		||||
{{ render_ipset(ipset | ipv4, name + "4", type=type, family=family, timeout=timeout) }}
 | 
			
		||||
{{ render_ipset(ipset | ipv6, name + "6", type=type, family="inet6", timeout=timeout) }}
 | 
			
		||||
{{ render_ipset(ipset | ansible.utils.ipv4, name + "4", type=type, family=family, timeout=timeout) }}
 | 
			
		||||
{{ render_ipset(ipset | ansible.utils.ipv6, name + "6", type=type, family="inet6", timeout=timeout) }}
 | 
			
		||||
{% endmacro %}
 | 
			
		||||
 | 
			
		||||
{{ render_dual_stack_ipset([], 'block') }}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
create {{ name }} {{ type | default('hash:net') }} family {{ family }} counters {% if timeout %}timeout {{ timeout }}{% endif %} -exist
 | 
			
		||||
flush {{ name }}
 | 
			
		||||
{% if ipset | length %}
 | 
			
		||||
{% for ip_or_net in ipset | ipv4 %}
 | 
			
		||||
{% for ip_or_net in ipset | ansible.utils.ipv4 %}
 | 
			
		||||
add {{ name }} {{ ip_or_net }}
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@
 | 
			
		||||
create {{ name }} {{ type | default('hash:net') }} family {{ family }} counters {% if timeout %}timeout {{ timeout }}{% endif %} -exist
 | 
			
		||||
flush {{ name }}
 | 
			
		||||
{% if ipset | length %}
 | 
			
		||||
{% for ip_or_net in ipset | ipv6 %}
 | 
			
		||||
{% for ip_or_net in ipset | ansible.utils.ipv6 %}
 | 
			
		||||
add {{ name }} {{ ip_or_net }}
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 
 | 
			
		||||
@@ -66,7 +66,7 @@
 | 
			
		||||
-A INPUT -i lo -m comment --comment "lo accept all" -j ACCEPT
 | 
			
		||||
 | 
			
		||||
{% if firewall_ssh_whitelist | length %}
 | 
			
		||||
{% for ip in firewall_ssh_whitelist | ipv4 %}
 | 
			
		||||
{% for ip in firewall_ssh_whitelist | ansible.utils.ipv4 %}
 | 
			
		||||
-A INPUT -p tcp -m tcp --dport 22 --source {{ ip }} -m comment --comment "accept {{ ip }} ssh 22/tcp" -j ACCEPT
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
@@ -94,7 +94,7 @@
 | 
			
		||||
-A INPUT -p icmp -m icmp --icmp-type echo-reply -m comment --comment "accept icmp echo-reply" -j ACCEPT
 | 
			
		||||
 | 
			
		||||
{% if firewall_allowed_icmp_types | length %}
 | 
			
		||||
{% for type in firewall_allowed_icmp_types | ipv4 %}
 | 
			
		||||
{% for type in firewall_allowed_icmp_types | ansible.utils.ipv4 %}
 | 
			
		||||
-A INPUT -p icmp -m icmp --icmp-type {{ type }} -m comment --comment "accept icmp {{ type }}" -j ACCEPT
 | 
			
		||||
{% endfor %}
 | 
			
		||||
{% endif %}
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ network:
 | 
			
		||||
{% if ansible_default_ipv4.address is defined or ansible_default_ipv6.address is defined %}
 | 
			
		||||
      addresses:
 | 
			
		||||
{% if ansible_default_ipv4.address is defined %}
 | 
			
		||||
        - {{ ansible_default_ipv4.address }}/{{ (ansible_default_ipv4.network + "/" + ansible_default_ipv4.netmask) | ipaddr('prefix') }}
 | 
			
		||||
        - {{ ansible_default_ipv4.address }}/{{ (ansible_default_ipv4.network + "/" + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('prefix') }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% if ansible_default_ipv6.address is defined %}
 | 
			
		||||
        - {{ ansible_default_ipv6.address }}/{{ ansible_default_ipv6.prefix }}
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ Name={{ ansible_default_ipv4.interface }}
 | 
			
		||||
{% if ansible_default_ipv4.address is defined or ansible_default_ipv6.address is defined %}
 | 
			
		||||
[Network]
 | 
			
		||||
{% if ansible_default_ipv4.address is defined %}
 | 
			
		||||
Address={{ ansible_default_ipv4.address }}/{{ (ansible_default_ipv4.network + "/" + ansible_default_ipv4.netmask) | ipaddr('prefix') }}
 | 
			
		||||
Address={{ ansible_default_ipv4.address }}/{{ (ansible_default_ipv4.network + "/" + ansible_default_ipv4.netmask) | ansible.utils.ipaddr('prefix') }}
 | 
			
		||||
{% endif %}
 | 
			
		||||
{% if ansible_default_ipv6.address is defined %}
 | 
			
		||||
Address={{ ansible_default_ipv6.address }}/{{ ansible_default_ipv6.prefix }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user