-
Notifications
You must be signed in to change notification settings - Fork 0
/
uinstallk8s.yml
115 lines (114 loc) · 2.83 KB
/
uinstallk8s.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
- hosts: all
user: root
tasks:
- name: disable service all
service:
name: "{{ item }}"
enabled: no
with_items:
- kubelet
- docker
- crio
- containerd
- kube-proxy
- kube-scheduler
- kube-controller-manager
- kube-apiserver
- etcd
- cri-docker
ignore_errors: True
- name: Reboot system
reboot:
reboot_timeout: 3600
- name: Remove file (delete file)
file:
path: "/lib/systemd/system/{{ item }}"
state: absent
with_items:
- kubelet.service
- docker.service
- crio.service
- containerd.service
- kube-proxy.service
- kube-scheduler.service
- kube-controller-manager.service
- kube-apiserver.service
- etcd.service
- docker.socket
- cri-docker.sock
- cri-docker.service
ignore_errors: True
- name: Remove file (delete file)
file:
path: "/usr/bin/{{ item }}"
state: absent
with_items:
- crictl
- docker
- docker
- docker-init
- docker-proxy
- containerd-shim
- runc
- ctr
- containerd
- cri-dockerd
ignore_errors: True
- name: Remove file (delete file)
file:
path: "/etc/{{ item }}"
state: absent
with_items:
- crictl.yaml
- containers
- containerd
- docker
- cni
ignore_errors: True
- name: Unmount k8s volume
mount:
path: "{{ item }}"
state: absent
with_items:
- /var/lib/docker
- /run/docker
- /var/lib/kubelet
- /var/lib/containers/storage
- /run/containers/storage
- /var/lib/containerd
- /run/containerd
# - name: remove mount K8S
# lineinfile:
# dest: /etc/fstab
# regexp: "^{{ item }}"
# line: "#{{ item }}"
# state: absent
# with_items:
# - /apps/docker/data
# - /apps/docker/root
# - /apps/work/kubernetes/kubelet
# - /apps/crio/lib/containers/storage
# - /apps/crio/run/containers/storage
# - /apps/containerd/containerd
# - /apps/containerd/run/containerd
- name: Remove file (delete file)
file:
path: "{{ item }}"
state: absent
with_items:
- /apps/etcd
- /apps/k8s
- /apps/work
- /apps/docker
- /opt/cni
- /apps/crio
- /apps/containerd
- /var/lib/docker
- /run/docker
- /var/lib/kubelet
- /var/lib/containers/storage
- /run/containers/storage
- /var/lib/containerd
- /run/containerd
- /var/lib/cni
ignore_errors: True