fix(partitioning): mount extra disks by UUID instead of device path
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
| selectattr('mount.path')
|
| selectattr('mount.path')
|
||||||
| list
|
| list
|
||||||
}}
|
}}
|
||||||
changed_when: false
|
|
||||||
|
|
||||||
- name: Validate additional disks do not target install_drive
|
- name: Validate additional disks do not target install_drive
|
||||||
when: partitioning_extra_disks | length > 0
|
when: partitioning_extra_disks | length > 0
|
||||||
@@ -59,7 +58,15 @@
|
|||||||
dev: "{{ item.partition }}"
|
dev: "{{ item.partition }}"
|
||||||
fstype: "{{ item.mount.fstype }}"
|
fstype: "{{ item.mount.fstype }}"
|
||||||
opts: "{{ _all_opts }}"
|
opts: "{{ _all_opts }}"
|
||||||
force: true
|
loop: "{{ partitioning_extra_disks }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.partition }}"
|
||||||
|
|
||||||
|
- name: Collect extra disk UUIDs
|
||||||
|
when: partitioning_extra_disks | length > 0
|
||||||
|
ansible.builtin.command: "blkid -s UUID -o value {{ item.partition }}"
|
||||||
|
register: partitioning_extra_disk_uuids
|
||||||
|
changed_when: false
|
||||||
loop: "{{ partitioning_extra_disks }}"
|
loop: "{{ partitioning_extra_disks }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.partition }}"
|
label: "{{ item.partition }}"
|
||||||
@@ -79,11 +86,11 @@
|
|||||||
- name: Mount additional disks for fstab generation
|
- name: Mount additional disks for fstab generation
|
||||||
when: partitioning_extra_disks | length > 0
|
when: partitioning_extra_disks | length > 0
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: "/mnt{{ item.mount.path }}"
|
path: "/mnt{{ item.0.mount.path }}"
|
||||||
src: "{{ item.partition }}"
|
src: "UUID={{ item.1.stdout }}"
|
||||||
fstype: "{{ item.mount.fstype }}"
|
fstype: "{{ item.0.mount.fstype }}"
|
||||||
opts: "{{ item.mount.opts | default('defaults') }}"
|
opts: "{{ item.0.mount.opts | default('defaults') }}"
|
||||||
state: mounted
|
state: mounted
|
||||||
loop: "{{ partitioning_extra_disks }}"
|
loop: "{{ partitioning_extra_disks | zip(partitioning_extra_disk_uuids.results) | list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.mount.path }}"
|
label: "{{ item.0.mount.path }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user