-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Ability to temporarily mount a filesystem without altering /etc/fstab #48134
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi @ahuffman, I think it might be a better idea to have a separate module for that. Normally, when there's a ton of options module accepts it's a sign that it should be broken into parts honoring the single responsibility principle. Also it's hard to use and test when the matrix of argument combos becomes huge. Do you want to try drafting such module? |
Seems like someone already tried to implement something along these lines, but never completed due to massive number of commit changes. |
@bbyhuy Thanks for filling me in on the other PR. That looks very similar to the functionality I was looking for. @webknjaz I could certainly take a crack at it, but the PR @bbyhuy mentioned is quite close. I may add a commit to the open PR if I can get some time this week. If the PR fails to be merged, I will definitely take a crack at breaking it out into it's own module, but I probably won't get to it until 2019. If I take that route, are there any preferences on module naming? I would think "temp_mount" or "mount_temp" would be decent names, but naming it that way could be confusing because it leads you to think of "/tmp". |
@ahuffman the new module name is up to you if you go for it, it'll be community-supported by default. I'd suggest maybe smth like live_mount/mount_live. |
Possible alternative to splitting this into two modules, add two new states, |
Duplicate of #19820. But seems to be a better approach to what have been done for now. If we go for a separate module, ideally this module should be called "mount" and the actual "mount" should be renamed to "fstab". But for backward compatibility reason i do not think it is possible. So… +1 for "mount_live". |
I like @BryanJeterCTR's idea @nikaro right, when renaming modules we still leave old name symlinked and it would not be possible to just replace it. Also, users will complain about "their old playbooks doing a different thing" in four versions from now... |
@BryanJeterCTR @webknjaz i have been told that the state should always be in paste tense: #35294 (comment) |
Ah.. Right. Past tense is better for sure :) |
So is there a consensus on how we want to go about this? Add a state or split it out as a new module? I can take a stab at it if @ahuffman isn't able to get to it til next year. Seems like making a mount_live module makes the most sense in terms of adding the requested functionality while keeping the original mount module safe from future "why is this not behaving the same" issues popping up. |
@bbyhuy something like How about Also it looks like ansible/lib/ansible/modules/system/mount.py Lines 682 to 689 in dda753d
|
|
@webknjaz you read my mind. I literally started implementing "mounted_live" just this morning. |
Hm, so I've implemented a mount_live function along with modifying the umount function a bit to handle openbsd specific live mounting. |
@bbyhuy I think it'll be easier for everyone to provide a feedback within some WIP PR as one can attach comments exactly to lines they refer to, which is better illustrative... |
This is the snippet I added based on mounted. The function call remount at L797 is what I'm referring to. This references to this function. Should i replace the remount call with just a umount / mounted_live combo? Or... |
@bbyhuy please send it as a PR, so that we could have the discussion there. |
If we do need to split that, However, I do have a conceptual problem with splitting |
We have |
@smurfix I'm absolutely with you. It makes sense to have the @dagwieers there is no problem to split the module. It's more about the convenience it brings if you use single module for both, the mounting and managing the |
I suppose splitting into two modules means that if I want to do both mount and fstab modification in a row, then I have to write two tasks, with almost identical parameters? Also it would be a breaking change, which costs users time to migrate in the future. I don't think it worth the trouble just to save a few options in
@dagwieers |
There has been some back-and-forth between the design of "ephemeral mounts". Has consensus been reached? Is someone working on this? To summarize it looks like:
Edit: it is extremely surprising that such basic functionality is still missing. My use case is chrooted/read-only file systems requiring temporary mounts. And I totally agree that the warning about using the |
Later arrival here. My use case is a very simple My 2 cents: one module to do all things mount related, but I could potentially see a separate |
Just to clarify: the position of Ansible Core team is that one module should do one thing. That's why we want a separate module with a distinct purpose. |
Yes, I read that several times throughout the thread. However, there seems to be at least two ways of seeing this "one thing". For some, myself included, that one thing is "managing mounts". Others, and apparently you, see that one thing as how that management is actually achieved. I don't buy a calculator expecting it to do spell checking, but I do expect it do multiple math operations. |
We aim to keep the number of module arguments. If it's big it's a sign that it's already doing too much. This leads to a combinatorial explosion of arg combos which is both hard to support/maintain and keep well-tested. |
When I understand it correctly, the suggested changes would add more options to the While I would prefer to have everything in one module with additional state options over having a separate module, in the end I don't care which one you choose as long as the issue gets resolved! I stumble over this problem regularly and use the |
Just stumbled over this again. It has been almost 3.5 years since the issue was first reported. How can we proceed to push this forward? |
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
SUMMARY
Ability to perform temporary mounts without altering /etc/fstab. Currently anything done with the mount module needs to manipulate /etc/fstab.
Additional parameter is needed to perform temporary mounts, such as with an ISO image that would be unmounted later in a play. Currently this can't be done with the mount module, as altering the /etc/fstab is required. Maybe call it "modify_fstab" and have it be a boolean. Currently the only way to achieve this is via the command module using direct mount/unmount commands.
ISSUE TYPE
COMPONENT NAME
mount, fstab
ADDITIONAL INFORMATION
To mount an ISO image temporarily for pulling in data, but not make an entry in /etc/fstab.
The text was updated successfully, but these errors were encountered: