diff --git a/roles/remove-node/post-remove/tasks/main.yml b/roles/remove-node/post-remove/tasks/main.yml index d1d0535c0..a4c72739f 100644 --- a/roles/remove-node/post-remove/tasks/main.yml +++ b/roles/remove-node/post-remove/tasks/main.yml @@ -2,7 +2,8 @@ - name: remove-node | Delete node command: "{{ kubectl }} delete node {{ kube_override_hostname|default(inventory_hostname) }}" delegate_to: "{{ groups['kube_control_plane']|first }}" - when: inventory_hostname in groups['k8s_cluster'] + # ignore servers that are not nodes + when: inventory_hostname in groups['k8s_cluster'] and 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 }}"