Skip to content

Commit

Permalink
Ignore deleting nodes that are not in cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
HoKim98 committed Sep 5, 2022
1 parent a1ea040 commit 97bcec2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion roles/remove-node/post-remove/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down

0 comments on commit 97bcec2

Please sign in to comment.