mirror of
https://github.com/k3s-io/k3s-ansible.git
synced 2024-09-26 03:42:39 +02:00
killall containerd-shim-runc-v2 added
umount k3s filesystems added
This commit is contained in:
parent
5ea14c1771
commit
4058ee42e6
@ -4,11 +4,26 @@
|
||||
name: "{{ item }}"
|
||||
state: stopped
|
||||
enabled: no
|
||||
failed_when: false
|
||||
failed_when: False
|
||||
with_items:
|
||||
- k3s
|
||||
- k3s-node
|
||||
|
||||
- name: Killall containerd-shim-runc-v2
|
||||
command: killall -9 containerd-shim-runc-v2
|
||||
failed_when: False
|
||||
changed_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
|
||||
file:
|
||||
name: "{{ item }}"
|
||||
|
13
roles/reset/tasks/umount_with_childeren.yml
Normal file
13
roles/reset/tasks/umount_with_childeren.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Get the list of mounted filesystems
|
||||
shell: cat /proc/mounts | awk '{ print $2}' | grep -E "^{{ mounted_fs }}"
|
||||
register: get_mounted_filesystems
|
||||
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
Block a user