Unverified Commit ad3dc65c authored by Julien DOCHE's avatar Julien DOCHE Committed by GitHub
Browse files

Merge pull request #66 from stafwag/master

reset role updated to killall containerd daemons and umount k3s filesystems
parents 39632b76 7bab4cb1
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -9,6 +9,22 @@
    - k3s
    - 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
  file:
    name: "{{ item }}"
+15 −0
Original line number Diff line number Diff line
---
- 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 }}"