mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 05:45:06 +03:00
ipaddr (deprecated alias) => ansible.utils.ipaddr (#10650)
This commit is contained in:
@@ -10,6 +10,6 @@
|
||||
"routes": [
|
||||
{ "dst": "0.0.0.0/0" }
|
||||
],
|
||||
"gateway": "{{ node_pod_cidr|ipaddr('net')|ipaddr(1)|ipaddr('address') }}"
|
||||
"gateway": "{{ node_pod_cidr|ansible.utils.ipaddr('net')|ansible.utils.ipaddr(1)|ansible.utils.ipaddr('address') }}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ NM_CONTROLLED=no
|
||||
MACVLAN_PARENT={{ macvlan_interface }}
|
||||
MACVLAN_MODE=bridge
|
||||
|
||||
IPADDR={{ node_pod_cidr|ipaddr('net')|ipaddr(1)|ipaddr('address') }}
|
||||
NETMASK={{ node_pod_cidr|ipaddr('netmask') }}
|
||||
NETWORK={{ node_pod_cidr|ipaddr('network') }}
|
||||
IPADDR={{ node_pod_cidr|ansible.utils.ipaddr('net')|ansible.utils.ipaddr(1)|ansible.utils.ipaddr('address') }}
|
||||
NETMASK={{ node_pod_cidr|ansible.utils.ipaddr('netmask') }}
|
||||
NETWORK={{ node_pod_cidr|ansible.utils.ipaddr('network') }}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% if enable_nat_default_gateway %}
|
||||
iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
|
||||
iptables -t nat -D POSTROUTING -s {{ node_pod_cidr|ansible.utils.ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
|
||||
{% endif %}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{% if enable_nat_default_gateway %}
|
||||
iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
|
||||
iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ansible.utils.ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE
|
||||
{% endif %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Name=mac0
|
||||
|
||||
[Network]
|
||||
Address={{ node_pod_cidr|ipaddr('net')|ipaddr(1)|ipaddr('address') }}/{{ node_pod_cidr|ipaddr('prefix') }}
|
||||
Address={{ node_pod_cidr|ansible.utils.ipaddr('net')|ansible.utils.ipaddr(1)|ansible.utils.ipaddr('address') }}/{{ node_pod_cidr|ansible.utils.ipaddr('prefix') }}
|
||||
|
||||
{% for host in groups['kube_node'] %}
|
||||
{% if hostvars[host]['access_ip'] is defined %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/bash -c "iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE"
|
||||
ExecStart=/bin/bash -c "iptables -t nat -I POSTROUTING -s {{ node_pod_cidr|ansible.utils.ipaddr('net') }} -o {{ node_default_gateway_interface }} -j MASQUERADE"
|
||||
|
||||
[Install]
|
||||
WantedBy=sys-subsystem-net-devices-mac0.device
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user