Thanks, I'll give that a shot.
I don't like the "explicitly sets all the flags that are reported by
ansible_mount" feature either so I might have to think about this more.
I guess I could note which mounts are missing "nodev", then use the
lineinfile: to rewrite the affected /etc/fstab lines an
You don't have to split the opts by comma, just checking if 'nodev' is
enough.
If it isn't there, you can then append it:
- name: "Add nodev to /tmp/mounts/mount*"
mount:
path: '/tmp/mounts/{{ item }}'
src: '/tmp/{{ item }}'
fstype: xfs
opts: '{{ (ansible_mounts|sele
I've got a variety of mounts that I want to ensure specific flags are set
on each. For other reasons, the mounts don't have the same flags.
I mistakenly thought the 'mount' module would ensure each had the flag, but
instead it set the flags of the mount to ONLY the 'opts' parameter.
For instan