blob: 24dfc8cfa5e85bbeb73eb7941428ec375d55bffa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Unmount all mounts
# If remove unmounted before absent, cannot unmount vyos_install_root...
- name: Unmount {{ vyos_install_root }}/boot
become: true
mount:
name: "{{ vyos_install_root }}/boot"
src: "{{ vyos_write_root }}"
fstype: none
state: unmounted
- name: Unmount {{ vyos_install_root }}/boot
become: true
mount:
name: "{{ vyos_install_root }}/boot"
src: "{{ vyos_write_root }}"
fstype: none
state: absent
- name: Unmount {{ vyos_install_root }}
become: true
mount:
name: "{{ vyos_install_root }}"
src: overlayfs
fstype: overlayfs
state: absent
- name: Unmount {{ vyos_read_root }}
become: true
mount:
name: "{{ vyos_read_root }}"
src: "{{ vyos_write_root }}/boot/{{ vyos_version }}/{{ vyos_version }}.squashfs"
fstype: squashfs
state: absent
- name: Unmount {{ vyos_write_root }}
become: true
mount:
name: "{{ vyos_write_root }}"
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:
name: "{{ vyos_cd_squash_root }}"
src: "{{ vyos_squashfs_image }}"
fstype: squashfs
state: absent
- name: Unmount {{ vyos_cd_root }}
become: true
mount:
name: "{{ vyos_cd_root }}"
src: "{{ vyos_iso_local }}"
fstype: iso9660
state: absent
|