Fix bug with disk mounts being mixed on reboot.
This commit is contained in:
parent
a35b504e59
commit
18d00b32de
@ -46,12 +46,13 @@
|
|||||||
dev: "{{ volume_output.attachments[0].device }}"
|
dev: "{{ volume_output.attachments[0].device }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
# Device names can change on reboot, we need to get UUID from Ansible facts.
|
||||||
- setup:
|
- setup:
|
||||||
- debug: var=ansible_facts
|
|
||||||
- name: mount /mnt/volumes/{{ volume.name }}
|
- name: mount /mnt/volumes/{{ volume.name }}
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
path: "/mnt/volumes/{{ volume.name }}"
|
path: "/mnt/volumes/{{ volume.name }}"
|
||||||
src: "{{ ansible_facts['ansible_device_links']['uuids'][volume_output.attachments[0].device.split('/')[-1]][0] }}"
|
src: "UUID={{ ansible_facts['device_links']['uuids'][volume_output.attachments[0].device.split('/')[-1]][0] }}"
|
||||||
fstype: ext4
|
fstype: ext4
|
||||||
state: mounted
|
state: mounted
|
||||||
become: true
|
become: true
|
||||||
|
Loading…
Reference in New Issue
Block a user