From befde271eb3e96c6a7338722876634b77a03a32d Mon Sep 17 00:00:00 2001 From: JSpon <115185500+JSpon@users.noreply.github.com> Date: Thu, 6 Oct 2022 18:03:52 -0400 Subject: [PATCH] Use hostname override in post-remove role, just as pre-remove role does (#9360) --- roles/remove-node/post-remove/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/remove-node/post-remove/tasks/main.yml b/roles/remove-node/post-remove/tasks/main.yml index a4c72739f..36b1e9ff8 100644 --- a/roles/remove-node/post-remove/tasks/main.yml +++ b/roles/remove-node/post-remove/tasks/main.yml @@ -3,7 +3,7 @@ command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}" delegate_to: "{{ groups['kube_control_plane']|first }}" # 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 }}" # Sometimes the api-server can have a short window of indisponibility when we delete a master node delay: "{{ delete_node_delay_seconds }}"