diff --git a/tasks/main.yml b/tasks/main.yml index 8236fdd..9223a60 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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