Loading roles/reset/tasks/main.yml +16 −0 Original line number Diff line number Diff line Loading @@ -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 }}" Loading roles/reset/tasks/umount_with_childeren.yml 0 → 100644 +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 }}" Loading
roles/reset/tasks/main.yml +16 −0 Original line number Diff line number Diff line Loading @@ -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 }}" Loading
roles/reset/tasks/umount_with_childeren.yml 0 → 100644 +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 }}"