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.

50 lines
1.3 KiB

  1. ---
  2. - hosts: localhost
  3. become: no
  4. gather_facts: no
  5. tasks:
  6. - name: "Check ansible version >=2.7.8"
  7. assert:
  8. msg: "Ansible must be v2.7.8 or higher"
  9. that:
  10. - ansible_version.string is version("2.7.8", ">=")
  11. tags:
  12. - check
  13. vars:
  14. ansible_connection: local
  15. - hosts: "{{ node | default('etcd:k8s-cluster:calico-rr') }}"
  16. gather_facts: no
  17. vars_prompt:
  18. name: "delete_nodes_confirmation"
  19. prompt: "Are you sure you want to delete nodes state? Type 'yes' to delete nodes."
  20. default: "no"
  21. private: no
  22. pre_tasks:
  23. - name: check confirmation
  24. fail:
  25. msg: "Delete nodes confirmation failed"
  26. when: delete_nodes_confirmation != "yes"
  27. - hosts: kube-master
  28. gather_facts: no
  29. roles:
  30. - { role: kubespray-defaults }
  31. - { role: remove-node/pre-remove, tags: pre-remove }
  32. - name: Gather facts
  33. import_playbook: facts.yml
  34. - hosts: "{{ node | default('kube-node') }}"
  35. gather_facts: no
  36. roles:
  37. - { role: kubespray-defaults }
  38. - { role: reset, tags: reset, when: reset_nodes|default(True) }
  39. # Currently cannot remove first master or etcd
  40. - hosts: "{{ node | default('kube-master[1:]:etcd[:1]') }}"
  41. gather_facts: no
  42. roles:
  43. - { role: kubespray-defaults }
  44. - { role: remove-node/post-remove, tags: post-remove }