-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
state = absent does not unmount path if it is not present in fstab #322
Comments
@NeodymiumFerBore Thank you for reporting this :) So, I will vote +1 to the following your opinion:
|
Hello. Thank you for your answer. I can do a PR during this week, it will not take long. |
Just adding a note so the I made different tests to be the most accurate possible in the new doc:
At this point, it is clear that
The new doc should include those corrections:
I will link a PR to this issue. |
I see this is still open. I'd like to advocate for changing the functionality so that "absent" means removed from fstab and unmounted. That is the true meaning of absent. The recent situation we ran into to illustrate the issue is as follows: We have an ansible task to create a mount with the The only workaround is to add two separate tasks, one with the state |
I would advocate for |
SUMMARY
When using
state=absent
, the mountpoint is not unmounted if it isn't present in the fstab file.ISSUE TYPE
COMPONENT NAME
mount module
ANSIBLE VERSION
COLLECTION VERSION
Note: this bug is also present in upstream in preparation of 1.4.0
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
/tmp/my_mountpoint
should have been unmounted.ACTUAL RESULTS
/tmp/my_mountpoint
is still mounted.MORE INFO
In this code, the condition
if changed
isTrue
only if changes occurred in the fstab file. The function unset_mount removes the givenpath
from the fstab, and returnschanged=True
if it did remove something. If the givenpath
is not in the fstab, then this change is not triggered, and the unmount is not executed.By looking at the documentation, I'm not sure this behavior is intended
FIX SUGGESTIONS
If this behavior is intended, then add a note in the
absent
documentation. Like "A filesystem mounted on a mountpoint that is not registered in the fstab will not be unmounted with this option. Use unmount instead".The text was updated successfully, but these errors were encountered: