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.

40 lines
1.1 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. vars_prompt:
  7. name: "delete_nodes_confirmation"
  8. prompt: "Are you sure you want to delete nodes state? Type 'yes' to delete nodes."
  9. default: "no"
  10. private: no
  11. pre_tasks:
  12. - name: check confirmation
  13. fail:
  14. msg: "Delete nodes confirmation failed"
  15. when: delete_nodes_confirmation != "yes"
  16. - hosts: kube-master
  17. gather_facts: no
  18. roles:
  19. - { role: kubespray-defaults }
  20. - { role: remove-node/pre-remove, tags: pre-remove }
  21. - name: Gather facts
  22. import_playbook: facts.yml
  23. - hosts: "{{ node | default('kube-node') }}"
  24. gather_facts: no
  25. roles:
  26. - { role: kubespray-defaults }
  27. - { role: remove-node/remove-etcd-node}
  28. - { role: reset, tags: reset, when: reset_nodes|default(True) }
  29. # Currently cannot remove first master or etcd
  30. - hosts: "{{ node | default('kube-master[1:]:etcd[1:]') }}"
  31. gather_facts: no
  32. roles:
  33. - { role: kubespray-defaults }
  34. - { role: remove-node/post-remove, tags: post-remove }