mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
---
|
|
- import_playbook: hook/pre_install.yaml
|
|
|
|
# Load default variables and perform prechecks on all hosts
|
|
- hosts:
|
|
- all
|
|
gather_facts: true
|
|
roles:
|
|
- defaults
|
|
|
|
- hosts:
|
|
- k8s_cluster
|
|
roles:
|
|
- uninstall/kubernetes
|
|
- role: uninstall/cri
|
|
when:
|
|
- .deleteCRI
|
|
- .groups.image_registry | default list | has .inventory_hostname | not
|
|
post_tasks:
|
|
- name: delete localDNS file
|
|
ignore_errors: true
|
|
loop: "{{ .native.localDNS | toJson }}"
|
|
command: |
|
|
sed -i ':a;$!{N;ba};s@# kubekey hosts BEGIN.*# kubekey hosts END@@' {{ .item }}
|
|
sed -i ':a;$!{N;ba};s@# kubekey kubernetes control_plane_endpoint BEGIN.*# kubekey kubernetes control_plane_endpoint END@@' {{ .item }}
|
|
sed -i ':a;$!{N;ba};s@# kubekey image_registry control_plane_endpoint BEGIN.*# kubekey image_registry control_plane_endpoint END@@' {{ .item }}
|
|
when: .deleteDNS
|
|
|
|
- hosts:
|
|
- etcd
|
|
roles:
|
|
- role: uninstall/etcd
|
|
when: .deleteETCD
|
|
|
|
- hosts:
|
|
- image_registry
|
|
roles:
|
|
- role: uninstall/image-registry
|
|
when:
|
|
- .deleteImageRegistry
|