2018-03-05 07:02:47 +00:00
|
|
|
---
|
2019-08-07 11:46:50 +00:00
|
|
|
- name: Lookup node IP in kubernetes
|
|
|
|
shell: >-
|
|
|
|
{{ bin_dir }}/kubectl get nodes {{ node }}
|
|
|
|
-o jsonpath='{range.status.addresses[?(@.type=="InternalIP")]}{.address}{"\n"}{end}'
|
|
|
|
register: remove_node_ip
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups['etcd']
|
|
|
|
- ip is not defined
|
|
|
|
- access_ip is not defined
|
|
|
|
delegate_to: "{{ groups['etcd']|first }}"
|
|
|
|
failed_when: false
|
|
|
|
|
2018-03-05 07:02:47 +00:00
|
|
|
- name: Delete node
|
2019-08-07 11:46:50 +00:00
|
|
|
command: "{{ bin_dir }}/kubectl delete node {{ inventory_hostname }}"
|
2018-06-23 06:40:59 +00:00
|
|
|
delegate_to: "{{ groups['kube-master']|first }}"
|
2018-03-05 07:02:47 +00:00
|
|
|
ignore_errors: yes
|