Use hostname override in post-remove role, just as pre-remove role does (#9360)

This commit is contained in:
JSpon 2022-10-06 18:03:52 -04:00 committed by GitHub
parent d689f57c94
commit befde271eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@
command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}" command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}"
delegate_to: "{{ groups['kube_control_plane']|first }}" delegate_to: "{{ groups['kube_control_plane']|first }}"
# ignore servers that are not nodes # ignore servers that are not nodes
when: inventory_hostname in groups['k8s_cluster'] and inventory_hostname in nodes.stdout_lines when: inventory_hostname in groups['k8s_cluster'] and kube_override_hostname|default(inventory_hostname) in nodes.stdout_lines
retries: "{{ delete_node_retries }}" retries: "{{ delete_node_retries }}"
# Sometimes the api-server can have a short window of indisponibility when we delete a master node # Sometimes the api-server can have a short window of indisponibility when we delete a master node
delay: "{{ delete_node_delay_seconds }}" delay: "{{ delete_node_delay_seconds }}"