Use a variable for roles of remove-node/post-remove (#9096)
Signed-off-by: ydFu <ader.ydfu@gmail.com>
This commit is contained in:
parent
7fa6314791
commit
09291bbdd2
2 changed files with 6 additions and 3 deletions
3
roles/remove-node/post-remove/defaults/main.yml
Normal file
3
roles/remove-node/post-remove/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
delete_node_retries: 10
|
||||||
|
delete_node_delay_seconds: 3
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
- name: Delete node
|
- name: remove-node | Delete node
|
||||||
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 }}"
|
||||||
when: inventory_hostname in groups['k8s_cluster']
|
when: inventory_hostname in groups['k8s_cluster']
|
||||||
retries: 10
|
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: 3
|
delay: "{{ delete_node_delay_seconds }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is not failed
|
until: result is not failed
|
||||||
|
|
Loading…
Reference in a new issue