forked from techno-tim/k3s-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.yml
56 lines (51 loc) · 1.23 KB
/
main.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
---
- name: Disable services
systemd:
name: "{{ item }}"
state: stopped
enabled: no
failed_when: false
with_items:
- k3s
- k3s-node
- k3s-init
- name: RUN pkill -9 -f "k3s/data/[^/]+/bin/containerd-shim-runc"
register: pkill_containerd_shim_runc
command: pkill -9 -f "k3s/data/[^/]+/bin/containerd-shim-runc"
changed_when: "pkill_containerd_shim_runc.rc == 0"
failed_when: false
- name: Umount k3s filesystems
include_tasks: umount_with_children.yml
with_items:
- /run/k3s
- /var/lib/kubelet
- /run/netns
- /var/lib/rancher/k3s
- /var/lib/kubelet/pods
- /var/lib/kubelet/plugins
- /run/netns/cni-
loop_control:
loop_var: mounted_fs
- name: Remove service files, binaries and data
file:
name: "{{ item }}"
state: absent
with_items:
- /usr/local/bin/k3s
- "{{ systemd_dir }}/k3s.service"
- "{{ systemd_dir }}/k3s-node.service"
- /etc/rancher/k3s
- /run/k3s
- /run/flannel
- /etc/rancher/
- /var/lib/kubelet
- /var/lib/rancher/k3s
- /var/lib/rancher/
- /var/lib/cni/
- name: Reload daemon_reload
systemd:
daemon_reload: yes
- name: Remove tmp directory used for manifests
file:
path: /tmp/k3s
state: absent