-
Notifications
You must be signed in to change notification settings - Fork 122
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
Mount location overrides ownership on an existing mountpoint #68
Comments
@ccope Here's the code that creates the directory for mounting the volume from the lvm_logical_volume provider:
If you have another earlier directory resource that created the directory owned by another user, this will run and change the owner to root. To get around the situation you have I would do this;
Your questions. Guard statements, pretty sure those execute as part of resource processing. mountpoint? and exist? check for very different things. HWRP check. Sure, serious overkill though. What chefspec does depends on your code. Unless you step into the providers (see the highlighted warning about doing this https://github.com/sethvargo/chefspec) chefspec doesn't know what happens in the providers. Making lots of assumptions about your chefspec code "Pathname.mountpoint?" in the resource provider was unlikely to have been invoked. Regards, |
Thanks Mark, that helps a lot. It was just a very surprising behavior, I only expected the provider to mount the logical volume, not also create the directory. The inability to test this also sucks (and trying to do it with serverspec requires a lot of setup since this requires extra block devices in my virtual machine). At this point I've rejected the following options:
The last idea I have is adding an option to the logical_volume provider, |
Testing - You can use loopback file systems for testing with serverspec. No extra block devices needed. I haven't checked the test setup here recently but lvm itself used to use that technique. The create_mountpoint option seems reasonable. Cheers |
I know this conversation is a little old, but I just ran into a similar situation. What about adding the ability to set the user, group, and mode from within the lvm_logicial_volume resource? It can still default to root,root,755. |
Which attributes do you mean, the mount point attributes or the attributes of the file system after it is mounted? |
I want to have a mount owned by a user. I tried creating the directory resources at the top of my recipe and then calling the logical_volume resource provider with the mount location option, but this caused the provider to create new directory resources that overrode my own. I would submit a PR but I have few questions:
The text was updated successfully, but these errors were encountered: