ansible.posix.mount: add absent_from_fstab option
SUMMARY
Add absent_from_fstab option to remove the entry from fstab, but not unmount or delete the folder. Ideally this would have been the behavior of absent (as to mirror the behavior of present), but for backward compatibility I added a new verbose state
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
mount
ADDITIONAL INFORMATION
Sometimes you may not want to delete the mountpoint (e.g. if it is not currently mounted and data is in the directory, the current behavior will simply error).
Reviewed-by: Amin Vakil <None>
Reviewed-by: None <None>
* Address the issue #28
* Modified behavior to set noauto option if boot is 'no' on Linux system
* Modified integration test to use filesize module instead of dd
Signed-off-by: Hideki Saito <saito@fgrep.org>
In Ansible 2.9 (pre 2.10 routing), the AnsiballZ creation of the payload
will add an extra directory to the module_util path because ismount.py
shares the same name as it's parent dir which creates an inconsistency
in the payload creation. This causes the Collection module
ansible.posix.mount to work in Ansible 2.10 but not 2.9, with this pull
request a simple renaming of the module_util which side steps this
inconsistency.
Fixes https://github.com/ansible-collections/ansible.posix/issues/21
Signed-off-by: Adam Miller <admiller@redhat.com>
This reverts part of ansible commit 72023d7462e78635264fd12bfdb23894b4163cba.
The immediate reason is that it breaks mounts where src is not a path.
Examples of such mounts are network-based filesystems such as nfs, cifs,
glusterfs, ceph, virtual filesystems such as tmpfs or overlayfs, and
also UUID-based mounts. It is too hard to come with an exhaustive list,
especially if we take non-Linux systems into account, so don't even try.
Additionally, it did not really fix the issue (ansible/ansible#59183) that
it intended to fix, because the mount could fail but leave a non-working
fstab entry for reasons other than non-existing src path.
Restore fstab and remove the mount point after a failed mount
Add a reminder that not only devices can be mounted
Fixes: ansible/ansible#65855Fixes: ansible/ansible#67588Fixes: ansible/ansible#67966
Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Co-authored-by: Alexander E. Patrakov <patrakov@gmail.com>