summaryrefslogtreecommitdiff
path: root/roles/unmount-all
diff options
context:
space:
mode:
Diffstat (limited to 'roles/unmount-all')
-rw-r--r--roles/unmount-all/tasks/main.yml11
1 files changed, 9 insertions, 2 deletions
diff --git a/roles/unmount-all/tasks/main.yml b/roles/unmount-all/tasks/main.yml
index 98d4cdd..24dfc8c 100644
--- a/roles/unmount-all/tasks/main.yml
+++ b/roles/unmount-all/tasks/main.yml
@@ -36,14 +36,21 @@
become: true
mount:
name: "{{ vyos_write_root }}"
- src: "{{ vyos_target_drive }}"
- fstype: "{{ vyos_root_fstype }}"
state: absent
- name: Remove image partitions
become: true
command: "kpartx -dv {{ vyos_raw_img }}"
+- name: Remove /dev/mapper entries
+ become: true
+ command: "dmsetup remove {{ item }}"
+ with_items: "{{ loop_partitions.stdout_lines }}"
+
+- name: Detach {{ loop_device.stdout }}
+ become: true
+ command: "losetup -d {{ loop_device.stdout }}"
+
- name: Unmount {{ vyos_cd_squash_root }}
become: true
mount: