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.

55 lines
1.6 KiB

  1. ---
  2. - name: Check ansible version
  3. import_playbook: ansible_version.yml
  4. - hosts: all
  5. gather_facts: false
  6. tags: always
  7. tasks:
  8. - name: "Set up proxy environment"
  9. set_fact:
  10. proxy_env:
  11. http_proxy: "{{ http_proxy | default ('') }}"
  12. HTTP_PROXY: "{{ http_proxy | default ('') }}"
  13. https_proxy: "{{ https_proxy | default ('') }}"
  14. HTTPS_PROXY: "{{ https_proxy | default ('') }}"
  15. no_proxy: "{{ no_proxy | default ('') }}"
  16. NO_PROXY: "{{ no_proxy | default ('') }}"
  17. no_log: true
  18. - hosts: "{{ node | default('etcd:k8s-cluster:calico-rr') }}"
  19. gather_facts: no
  20. vars_prompt:
  21. name: "delete_nodes_confirmation"
  22. prompt: "Are you sure you want to delete nodes state? Type 'yes' to delete nodes."
  23. default: "no"
  24. private: no
  25. pre_tasks:
  26. - name: check confirmation
  27. fail:
  28. msg: "Delete nodes confirmation failed"
  29. when: delete_nodes_confirmation != "yes"
  30. - hosts: kube-master
  31. gather_facts: no
  32. roles:
  33. - { role: kubespray-defaults }
  34. - { role: remove-node/pre-remove, tags: pre-remove }
  35. - name: Gather facts
  36. import_playbook: facts.yml
  37. - hosts: "{{ node | default('kube-node') }}"
  38. gather_facts: no
  39. roles:
  40. - { role: kubespray-defaults }
  41. - { role: remove-node/remove-etcd-node}
  42. - { role: reset, tags: reset, when: reset_nodes|default(True) }
  43. # Currently cannot remove first master or etcd
  44. - hosts: "{{ node | default('kube-master[1:]:etcd[1:]') }}"
  45. gather_facts: no
  46. roles:
  47. - { role: kubespray-defaults }
  48. - { role: remove-node/post-remove, tags: post-remove }