--- - name: Create folders to mount to file: path: "{{ item.path }}" state: directory loop: "{{ fstab_entries }}" become: true - name: Create fstab entries mount: src: "UUID={{ item.uuid }}" path: "{{ item.path }}" fstype: "{{ item.type }}" state: present backup: true loop: "{{ fstab_entries }}" become: true register: fstab - name: Mount all disks command: mount -a become: true when: fstab.changed