2023-03-27 17:25:55 +08:00
|
|
|
---
|
2023-12-05 06:24:00 +08:00
|
|
|
- name: Common tasks for every playbooks
|
|
|
|
import_playbook: boilerplate.yml
|
2023-03-27 17:25:55 +08:00
|
|
|
|
|
|
|
- name: Gather facts
|
|
|
|
import_playbook: facts.yml
|
|
|
|
|
2023-07-26 22:36:22 +08:00
|
|
|
- name: Reset cluster
|
|
|
|
hosts: etcd:k8s_cluster:calico_rr
|
2023-03-27 17:25:55 +08:00
|
|
|
gather_facts: False
|
|
|
|
pre_tasks:
|
2023-06-26 18:15:45 +08:00
|
|
|
- name: Reset Confirmation
|
|
|
|
pause:
|
|
|
|
prompt: "Are you sure you want to reset cluster state? Type 'yes' to reset your cluster."
|
2023-07-24 14:58:14 +08:00
|
|
|
register: reset_confirmation_prompt
|
2023-06-26 18:15:45 +08:00
|
|
|
run_once: True
|
|
|
|
when:
|
|
|
|
- not (skip_confirmation | default(false) | bool)
|
2023-07-18 20:45:10 +08:00
|
|
|
- reset_confirmation is not defined
|
2023-07-24 14:58:14 +08:00
|
|
|
|
2023-06-26 18:15:45 +08:00
|
|
|
- name: Check confirmation
|
2023-03-27 17:25:55 +08:00
|
|
|
fail:
|
|
|
|
msg: "Reset confirmation failed"
|
2023-07-18 20:45:10 +08:00
|
|
|
when:
|
|
|
|
- not reset_confirmation | default(false) | bool
|
|
|
|
- not reset_confirmation_prompt.user_input | default("") == "yes"
|
2023-03-27 17:25:55 +08:00
|
|
|
|
|
|
|
- name: Gather information about installed services
|
|
|
|
service_facts:
|
|
|
|
|
|
|
|
environment: "{{ proxy_disable_env }}"
|
|
|
|
roles:
|
|
|
|
- { role: kubespray-defaults}
|
|
|
|
- { role: kubernetes/preinstall, when: "dns_mode != 'none' and resolvconf_mode == 'host_resolvconf'", tags: resolvconf, dns_early: true }
|
|
|
|
- { role: reset, tags: reset }
|