ansible.posix
ansible.posix copied to clipboard
Add option to not remove mountpoint
SUMMARY
It would be useful to add the option to preserve the mountpoint directory when the state is set to absent
.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
ansible.posix.mount (plugins/modules/mount.py)
ADDITIONAL INFORMATION
I use network mounts over certain directories that varies from host to host. Nearly every time I specify the state as absent
, it's because I want to ensure that a host is using the native filesystem rather than a network share. I want the underlying directory to still exist and rather not have to use a file
task.
EDIT: I'm happy to do a PR don't have a good name for the option. It could also double as a flag to not have this task create directories needed for the mount.
@Caligatio thank you for the feature request. I can't think of any good name for this option, but I agree with this request :)
Hello.
What about a boolean preserve_mountpoint, default to False
so it keeps the actual behavior by default?
I could do a PR for this. @saito-hideki , do you know if there is any work in progress regarding this issue?
Despite my best intentions, I personally haven't started on it yet. It's ultimately implementers choice but manage_mointpoint
might be worth considering as it could be used for both creation and deletion.