summaryrefslogtreecommitdiff
path: root/roles/unmount-all/tasks/main.yml
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2018-06-28 01:23:02 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2018-06-28 01:23:02 +0900
commit86f71d4334f2269ff8f0268d200f03b73e1c26b7 (patch)
tree1fe8415733cdf993549ae6bcf067f4ea6c272e03 /roles/unmount-all/tasks/main.yml
parentebf269e8926d3dbd2a543aabe598ef4cfa68a5ff (diff)
downloadvyos-vm-images-86f71d4334f2269ff8f0268d200f03b73e1c26b7.tar.gz
vyos-vm-images-86f71d4334f2269ff8f0268d200f03b73e1c26b7.zip
Cleanup playbook
Diffstat (limited to 'roles/unmount-all/tasks/main.yml')
-rw-r--r--roles/unmount-all/tasks/main.yml75
1 files changed, 75 insertions, 0 deletions
diff --git a/roles/unmount-all/tasks/main.yml b/roles/unmount-all/tasks/main.yml
new file mode 100644
index 0000000..1ff6daa
--- /dev/null
+++ b/roles/unmount-all/tasks/main.yml
@@ -0,0 +1,75 @@
+# 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 }}/sys, {{ vyos_install_root }}/proc, {{ vyos_install_root }}/dev
+ become: true
+ mount:
+ name: "{{ vyos_install_root }}/{{ item }}"
+ src: "/{{ item }}"
+ fstype: none
+ state: unmounted
+ with_items: [ 'sys', 'proc', 'dev' ]
+
+- name: Unmount {{ vyos_install_root }}/sys, {{ vyos_install_root }}/proc, {{ vyos_install_root }}/dev
+ become: true
+ mount:
+ name: "{{ vyos_install_root }}/{{ item }}"
+ src: "/{{ item }}"
+ fstype: none
+ state: absent
+ with_items: [ 'sys', 'proc', 'dev' ]
+
+- 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 }}"
+ src: "{{ vyos_target_drive }}"
+ fstype: "{{ vyos_root_fstype }}"
+ state: absent
+
+- 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