arensb / ansible-truenas

Ansible collection to manage TrueNAS
Apache License 2.0
34 stars 7 forks source link

Can't have the same NFS mount point with different permissions #16

Open steven-ellis opened 6 months ago

steven-ellis commented 6 months ago

Example would be to export my MP3 directory ro to media players but rw to my desktop

- name: RO export for media players
  arensb.truenas.sharing_nfs:
    - name: MP3 ro export
      path: /mnt/pool0/MP3
      readonly: false
      hosts:
            - 192.168.1.8
            - 192.168.1.9

- name: RW Export for my desktop
  arensb.truenas.sharing_nfs:
    - name: MP3 rw export
      readonly: true
      path: /mnt/pool0/MP3
      hosts:
            - 192.168.1.2

Only the second share will be created when you check the GUI on TrueNAS Scale.

Look like you're using "path" as the unique identified when it is possible to have mutiple exports with the same path.

arensb commented 4 months ago

I haven't been able to reproduce this bug. I notice that you have an extra dash after .sharing_nfs:\n. But even correcting for that, I was able to create a volume with separate read-only and read-write exports to different sets of hosts.

Could you please run ansible-playbook -C -vvv myplaybook.yml, and if that succeeds, ansible-playbook -vvv myplaybook.yml, where myplaybook.yml has your play, above? I'd like to see exactly what it's trying to do and where it's failing.