You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.6 KiB

  1. ---
  2. - name: Check ansible version
  3. import_playbook: ansible_version.yml
  4. - name: Ensure compatibility with old groups
  5. import_playbook: legacy_groups.yml
  6. - hosts: "{{ node | default('etcd:k8s_cluster:calico_rr') }}"
  7. gather_facts: no
  8. environment: "{{ proxy_disable_env }}"
  9. vars_prompt:
  10. name: "delete_nodes_confirmation"
  11. prompt: "Are you sure you want to delete nodes state? Type 'yes' to delete nodes."
  12. default: "no"
  13. private: no
  14. pre_tasks:
  15. - name: check confirmation
  16. fail:
  17. msg: "Delete nodes confirmation failed"
  18. when: delete_nodes_confirmation != "yes"
  19. - hosts: kube_control_plane[0]
  20. gather_facts: no
  21. environment: "{{ proxy_disable_env }}"
  22. roles:
  23. - { role: kubespray-defaults }
  24. - { role: bootstrap-os, tags: bootstrap-os }
  25. - { role: remove-node/pre-remove, tags: pre-remove }
  26. - hosts: "{{ node | default('kube_node') }}"
  27. gather_facts: no
  28. environment: "{{ proxy_disable_env }}"
  29. roles:
  30. - { role: kubespray-defaults, when: reset_nodes|default(True)|bool }
  31. - { role: bootstrap-os, tags: bootstrap-os, when: reset_nodes|default(True)|bool }
  32. - { role: remove-node/remove-etcd-node }
  33. - { role: reset, tags: reset, when: reset_nodes|default(True)|bool }
  34. # Currently cannot remove first master or etcd
  35. - hosts: "{{ node | default('kube_control_plane[1:]:etcd[1:]') }}"
  36. gather_facts: no
  37. environment: "{{ proxy_disable_env }}"
  38. roles:
  39. - { role: kubespray-defaults, when: reset_nodes|default(True)|bool }
  40. - { role: bootstrap-os, tags: bootstrap-os, when: reset_nodes|default(True)|bool }
  41. - { role: remove-node/post-remove, tags: post-remove }