Fix bug with disk mounts being mixed on reboot.

This commit is contained in:
yohan 2024-10-19 22:27:21 +02:00
parent a35b504e59
commit 18d00b32de

View File

@ -46,12 +46,13 @@
dev: "{{ volume_output.attachments[0].device }}"
become: true
# Device names can change on reboot, we need to get UUID from Ansible facts.
- setup:
- debug: var=ansible_facts
- name: mount /mnt/volumes/{{ volume.name }}
ansible.posix.mount:
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
state: mounted
become: true