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.2 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. - hosts: "{{ node | default('kube-node') }}"
  33. gather_facts: yes
  34. roles:
  35. - { role: kubespray-defaults }
  36. - { role: reset, tags: reset, when: reset_nodes|default(True) }
  37. # Currently cannot remove first master or etcd
  38. - hosts: "{{ node | default('kube-master[1:]:etcd[:1]') }}"
  39. gather_facts: yes
  40. roles:
  41. - { role: kubespray-defaults }
  42. - { role: remove-node/post-remove, tags: post-remove }