umask option for the ansible.posix.mount module #163
Labels
feature
This issue/PR relates to a feature request.
waiting_on_contributor
Needs help. Feel free to engage to get things unblocked
SUMMARY
When using the ansible.posix.mount module to mount a filesystem under a directory structure which is not existent, the module creates the directories with the umask which is defined for the root user.
If the default umask for root is set that "other" has no permissions on newly created directories, the mount module mounts the filesystem - but no one can access it other then root because traversing the directories is not possible.
for example you want a filesystem mounted under "/myapps/app1" and both directories are non-existent:
umask is set to
0027
Using ansible to mount the filesystem
Now the module created the directory "/myapps/" and "/myapps/app1/" and the Filesystem is mounted under
/myapps/app1
But the Directory /myapps/ got the permissions 750 and I can't access the mounted filesystem as a user != root - no matter what the mounted filesystem has for permissions
An option to avoid this situation would be to specify the umask on calling the module like with the "git" module.
if you could set umask=0022 - all directories which gets created automatically would be created that you can traverse these directories.
ISSUE TYPE
COMPONENT NAME
ansible.posix.mount
ADDITIONAL INFORMATION
ansible localhost -m mount -a "umask=0022 src=tmpfs path=/myapps/app1 fstype=tmpfs state=mounted"
That would cause ansible to set the umask for that specific task and the parent directories would get the propper permission - if this is wanted.
The text was updated successfully, but these errors were encountered: