2018-08-23 22:17:18 +08:00
|
|
|
---
|
2020-09-03 14:55:40 +08:00
|
|
|
- name: Calico | Get kubelet hostname
|
2018-08-23 22:17:18 +08:00
|
|
|
shell: >-
|
2020-09-03 14:55:40 +08:00
|
|
|
set -o pipefail && {{ bin_dir }}/kubectl get node -o custom-columns='NAME:.metadata.name,INTERNAL-IP:.status.addresses[?(@.type=="InternalIP")].address'
|
2018-08-23 22:17:18 +08:00
|
|
|
| egrep "{{ ansible_all_ipv4_addresses | join('$|') }}$" | cut -d" " -f1
|
2020-09-03 14:55:40 +08:00
|
|
|
args:
|
|
|
|
executable: /bin/bash
|
2018-08-23 22:17:18 +08:00
|
|
|
register: calico_kubelet_name
|
|
|
|
delegate_to: "{{ groups['kube-master'][0] }}"
|
|
|
|
when:
|
2019-04-19 21:01:54 +08:00
|
|
|
- "cloud_provider is defined"
|