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.

44 lines
1.5 KiB

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