Merge pull request #66 from stafwag/master
reset role updated to killall containerd daemons and umount k3s filesystemspull/74/head
commit
ad3dc65cd9
|
@ -9,6 +9,22 @@
|
||||||
- k3s
|
- k3s
|
||||||
- k3s-node
|
- k3s-node
|
||||||
|
|
||||||
|
- name: 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_childeren.yml
|
||||||
|
with_items:
|
||||||
|
- /run/k3s
|
||||||
|
- /var/lib/kubelet
|
||||||
|
- /run/netns
|
||||||
|
- /var/lib/rancher/k3s
|
||||||
|
loop_control:
|
||||||
|
loop_var: mounted_fs
|
||||||
|
|
||||||
- name: Remove service files, binaries and data
|
- name: Remove service files, binaries and data
|
||||||
file:
|
file:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
- name: Get the list of mounted filesystems
|
||||||
|
shell: set -o pipefail && cat /proc/mounts | awk '{ print $2}' | grep -E "^{{ mounted_fs }}"
|
||||||
|
register: get_mounted_filesystems
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
failed_when: false
|
||||||
|
changed_when: get_mounted_filesystems.stdout | length > 0
|
||||||
|
|
||||||
|
- name: Umount filesystem
|
||||||
|
mount:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: unmounted
|
||||||
|
with_items:
|
||||||
|
"{{ get_mounted_filesystems.stdout_lines }}"
|
Loading…
Reference in New Issue