diff --git a/galaxy.yml b/galaxy.yml index 497ac44b9..a0df3882c 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -9,6 +9,8 @@ authors: tags: - infrastructure repository: https://github.com/kubernetes-sigs/kubespray +dependencies: + ansible.utils: '>=2.5.0' build_ignore: - .github - '*.tar.gz' diff --git a/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml b/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml index fade43c26..93a8fda66 100644 --- a/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml +++ b/roles/kubernetes/control-plane/tasks/kubeadm-setup.yml @@ -110,7 +110,7 @@ - name: Kubeadm | Check apiserver.crt SANs vars: - apiserver_ips: "{{ apiserver_sans | map('ipaddr') | reject('equalto', False) | list }}" + apiserver_ips: "{{ apiserver_sans | map('ansible.utils.ipaddr') | reject('equalto', False) | list }}" apiserver_hosts: "{{ apiserver_sans | difference(apiserver_ips) }}" when: - kubeadm_already_run.stat.exists diff --git a/roles/kubernetes/preinstall/tasks/0020-set_facts.yml b/roles/kubernetes/preinstall/tasks/0020-set_facts.yml index 5bd4181c4..3d41050f5 100644 --- a/roles/kubernetes/preinstall/tasks/0020-set_facts.yml +++ b/roles/kubernetes/preinstall/tasks/0020-set_facts.yml @@ -79,7 +79,7 @@ - name: Get currently configured nameservers set_fact: - configured_nameservers: "{{ resolvconf_slurp.content | b64decode | regex_findall('^nameserver\\s*(\\S*)', multiline=True) | ipaddr }}" + configured_nameservers: "{{ resolvconf_slurp.content | b64decode | regex_findall('^nameserver\\s*(\\S*)', multiline=True) | ansible.utils.ipaddr }}" when: resolvconf_slurp.content is defined - name: Stop if /etc/resolv.conf not configured nameservers diff --git a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml index 8cc11b6d5..178becf3e 100644 --- a/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml +++ b/roles/kubernetes/preinstall/tasks/0040-verify-settings.yml @@ -166,28 +166,28 @@ - name: "Check that kube_service_addresses is a network range" assert: that: - - kube_service_addresses | ipaddr('net') + - kube_service_addresses | ansible.utils.ipaddr('net') msg: "kube_service_addresses = '{{ kube_service_addresses }}' is not a valid network range" run_once: yes - name: "Check that kube_pods_subnet is a network range" assert: that: - - kube_pods_subnet | ipaddr('net') + - kube_pods_subnet | ansible.utils.ipaddr('net') msg: "kube_pods_subnet = '{{ kube_pods_subnet }}' is not a valid network range" run_once: yes - name: "Check that kube_pods_subnet does not collide with kube_service_addresses" assert: that: - - kube_pods_subnet | ipaddr(kube_service_addresses) | string == 'None' + - kube_pods_subnet | ansible.utils.ipaddr(kube_service_addresses) | string == 'None' msg: "kube_pods_subnet cannot be the same network segment as kube_service_addresses" run_once: yes - name: "Check that IP range is enough for the nodes" assert: that: - - 2 ** (kube_network_node_prefix - kube_pods_subnet | ipaddr('prefix')) >= groups['k8s_cluster'] | length + - 2 ** (kube_network_node_prefix - kube_pods_subnet | ansible.utils.ipaddr('prefix')) >= groups['k8s_cluster'] | length msg: "Not enough IPs are available for the desired node count." when: kube_network_plugin != 'calico' run_once: yes diff --git a/roles/network_plugin/calico/tasks/install.yml b/roles/network_plugin/calico/tasks/install.yml index d371440a3..7944295dd 100644 --- a/roles/network_plugin/calico/tasks/install.yml +++ b/roles/network_plugin/calico/tasks/install.yml @@ -87,7 +87,7 @@ - name: Calico | Ensure that calico_pool_cidr is within kube_pods_subnet when defined assert: - that: "[calico_pool_cidr] | ipaddr(kube_pods_subnet) | length == 1" + that: "[calico_pool_cidr] | ansible.utils.ipaddr(kube_pods_subnet) | length == 1" msg: "{{ calico_pool_cidr }} is not within or equal to {{ kube_pods_subnet }}" when: - inventory_hostname == groups['kube_control_plane'][0] @@ -111,7 +111,7 @@ - name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined assert: - that: "[calico_pool_cidr_ipv6] | ipaddr(kube_pods_subnet_ipv6) | length == 1" + that: "[calico_pool_cidr_ipv6] | ansible.utils.ipaddr(kube_pods_subnet_ipv6) | length == 1" msg: "{{ calico_pool_cidr_ipv6 }} is not within or equal to {{ kube_pods_subnet_ipv6 }}" when: - inventory_hostname == groups['kube_control_plane'][0]