Skip to content
Snippets Groups Projects
Unverified Commit 401ea552 authored by Max Gautier's avatar Max Gautier Committed by GitHub
Browse files

Cleanup a deprecation warning (ipaddr filter) (#10518)

parent 8cce6df8
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ authors: ...@@ -9,6 +9,8 @@ authors:
tags: tags:
- infrastructure - infrastructure
repository: https://github.com/kubernetes-sigs/kubespray repository: https://github.com/kubernetes-sigs/kubespray
dependencies:
ansible.utils: '>=2.5.0'
build_ignore: build_ignore:
- .github - .github
- '*.tar.gz' - '*.tar.gz'
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
- name: Kubeadm | Check apiserver.crt SANs - name: Kubeadm | Check apiserver.crt SANs
vars: 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) }}" apiserver_hosts: "{{ apiserver_sans | difference(apiserver_ips) }}"
when: when:
- kubeadm_already_run.stat.exists - kubeadm_already_run.stat.exists
......
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
- name: Get currently configured nameservers - name: Get currently configured nameservers
set_fact: 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 when: resolvconf_slurp.content is defined
- name: Stop if /etc/resolv.conf not configured nameservers - name: Stop if /etc/resolv.conf not configured nameservers
......
...@@ -166,28 +166,28 @@ ...@@ -166,28 +166,28 @@
- name: "Check that kube_service_addresses is a network range" - name: "Check that kube_service_addresses is a network range"
assert: assert:
that: 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" msg: "kube_service_addresses = '{{ kube_service_addresses }}' is not a valid network range"
run_once: yes run_once: yes
- name: "Check that kube_pods_subnet is a network range" - name: "Check that kube_pods_subnet is a network range"
assert: assert:
that: 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" msg: "kube_pods_subnet = '{{ kube_pods_subnet }}' is not a valid network range"
run_once: yes run_once: yes
- name: "Check that kube_pods_subnet does not collide with kube_service_addresses" - name: "Check that kube_pods_subnet does not collide with kube_service_addresses"
assert: assert:
that: 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" msg: "kube_pods_subnet cannot be the same network segment as kube_service_addresses"
run_once: yes run_once: yes
- name: "Check that IP range is enough for the nodes" - name: "Check that IP range is enough for the nodes"
assert: assert:
that: 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." msg: "Not enough IPs are available for the desired node count."
when: kube_network_plugin != 'calico' when: kube_network_plugin != 'calico'
run_once: yes run_once: yes
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
- name: Calico | Ensure that calico_pool_cidr is within kube_pods_subnet when defined - name: Calico | Ensure that calico_pool_cidr is within kube_pods_subnet when defined
assert: 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 }}" msg: "{{ calico_pool_cidr }} is not within or equal to {{ kube_pods_subnet }}"
when: when:
- inventory_hostname == groups['kube_control_plane'][0] - inventory_hostname == groups['kube_control_plane'][0]
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
- name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined - name: Calico | Ensure that calico_pool_cidr_ipv6 is within kube_pods_subnet_ipv6 when defined
assert: 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 }}" msg: "{{ calico_pool_cidr_ipv6 }} is not within or equal to {{ kube_pods_subnet_ipv6 }}"
when: when:
- inventory_hostname == groups['kube_control_plane'][0] - inventory_hostname == groups['kube_control_plane'][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment