ipaddr (deprecated alias) => ansible.utils.ipaddr (#10650)

This commit is contained in:
Max Gautier
2023-11-28 09:56:55 +01:00
committed by GitHub
parent cf3ac625da
commit 94d3f65f09
8 changed files with 17 additions and 17 deletions

View File

@@ -1,9 +1,9 @@
auto mac0
iface mac0 inet static
address {{ node_pod_cidr|ipaddr('net')|ipaddr(1)|ipaddr('address') }}
network {{ node_pod_cidr|ipaddr('network') }}
netmask {{ node_pod_cidr|ipaddr('netmask') }}
broadcast {{ node_pod_cidr|ipaddr('broadcast') }}
address {{ node_pod_cidr|ansible.utils.ipaddr('net')|ansible.utils.ipaddr(1)|ansible.utils.ipaddr('address') }}
network {{ node_pod_cidr|ansible.utils.ipaddr('network') }}
netmask {{ node_pod_cidr|ansible.utils.ipaddr('netmask') }}
broadcast {{ node_pod_cidr|ansible.utils.ipaddr('broadcast') }}
pre-up ip link add link {{ macvlan_interface }} mac0 type macvlan mode bridge
{% for host in groups['kube_node'] %}
{% if hostvars[host]['access_ip'] is defined %}
@@ -13,7 +13,7 @@ iface mac0 inet static
{% endif %}
{% endfor %}
{% if enable_nat_default_gateway %}
post-up iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
post-up iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ansible.utils.ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
{% endif %}
{% for host in groups['kube_node'] %}
{% if hostvars[host]['access_ip'] is defined %}
@@ -22,5 +22,5 @@ iface mac0 inet static
{% endif %}
{% endif %}
{% endfor %}
post-down iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ansible.utils.ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
post-down ip link delete mac0