User story #4211
closedThe fstab technique should mount file system
Description
The fstab technique doesn't mount file systems. Now I have to do a "mount -a" manually on all nodes which use the technique.
Updated by Matthieu CERDA almost 11 years ago
- Category set to Techniques
- Status changed from New to Discussion
- Assignee set to Matthieu CERDA
- Priority changed from N/A to 3
Hello Dennis.
This Technique is only intended to edit fstab files by design. However, do you think that adding an option to mount automatically the added filesystems would be cool ?
Updated by Dennis Cabooter almost 11 years ago
To be honest, to add fstab entries without mounting them is pretty useless, isn't it? Why add a file system to fstab if you don't want to mount it. However, it should be optional.
Updated by Jonathan CLARKE almost 11 years ago
- Tracker changed from Bug to User story
- Status changed from Discussion to 8
- Assignee deleted (
Matthieu CERDA) - Target version set to Ideas (not version specific)
This was not intended in the design. This technique was created to ensure that fstab was compliant (options, especially).
I'll reclassify it as a user story, but I'm afraid it's not something we have time to work on at the moment.
Updated by Jonathan CLARKE almost 11 years ago
- Subject changed from The fstab technique doesn't mount file systems to The fstab technique should mount file systems
Updated by Dennis Cabooter almost 11 years ago
It would only be one check box to trigger /sbin/mount -a optionally.
Updated by Jonathan CLARKE almost 11 years ago
Dennis Cabooter wrote:
It would only be one check box to trigger /sbin/mount -a optionally.
I know, and I would love to accept a patch if you can write one for us? :)
Updated by Dennis Cabooter almost 11 years ago
Can't promise if can make it to a correct patch, but I'm definatly willing to try. :-)
Updated by Dennis Cabooter over 10 years ago
Ok, the XML part was quitte easy to do. I made it so that one can choose to create a mountpoint and/or mount a mountpoint per fstab entry. I've looked into the CFEngine part of other techniques and for me it's very hard to understand how to add these two options into the CFEngine part of the technique. I'm sure willing to do the work, but I will need some support/help from a technique guru. Please understand that the documentation about writing techniques is not very much. And I do know some CFEngine3 syntax, but there's more, like declaring variables in the first place and logging in the end.
Here's my proposal about the XML file:
--- 2.0/metadata.xml 2014-01-15 13:56:59.000000000 +0100 +++ 2.1/metadata.xml 2014-03-06 09:44:28.000000000 +0100 @@ -408,6 +408,36 @@ <DEFAULT>2</DEFAULT> </CONSTRAINT> </SELECT1> + <SELECT1> + <NAME>FSTAB_CREATE_MP</NAME> + <DESCRIPTION>Should the mountpoint be created</DESCRIPTION> + <ITEM> + <LABEL>Yes</LABEL> + <VALUE>1</VALUE> + </ITEM> + <ITEM> + <LABEL>No</LABEL> + <VALUE>0</VALUE> + </ITEM> + <CONSTRAINT> + <DEFAULT>0</DEFAULT> + </CONSTRAINT> + </SELECT1> + <SELECT1> + <NAME>FSTAB_MOUNT_MP</NAME> + <DESCRIPTION>Should the mountpoint be mounted</DESCRIPTION> + <ITEM> + <LABEL>Yes</LABEL> + <VALUE>1</VALUE> + </ITEM> + <ITEM> + <LABEL>No</LABEL> + <VALUE>0</VALUE> + </ITEM> + <CONSTRAINT> + <DEFAULT>0</DEFAULT> + </CONSTRAINT> + </SELECT1> </SECTION> </SECTIONS> </TECHNIQUE>
Updated by Nicolas CHARLES over 10 years ago
Dennis,
if I were you, I would create a section for mounting the mount point, with a component name (i let the choice up to you, and I'll name it "COMPONENT NAME" for the rest of this message), as it is clearly another action than simply editing the file, and it would really ease everything.
then, for the CFEngine part, you would need to have a classes: promises, with something like
&FSTAB_CREATE_MP:{create_mountpoint |"create_mountpoint_&i&" not => strcmp("&create_mountpoint&", "1"); }& &FSTAB_MOUNT_MP:{mount_mountpoint |"mount_mountpoint_&i&" not => strcmp("&mount_mountpoint&", "1"); }&
then to create the mountpoint, you'd need to add a promise in the promise of type file
"${fstab[${fstab_index}][destination]}/." create => "true", ifvarclass => "create_mountpoint_${fstab_index}", classes => rudder_common_classes("create_mountpoint_${fstab_index}");
Note - i'm not sure of which permissions this folder should have
and make reports based on this, you could use the rudder_common_reports_generic bundle
methods: "reports on mountpoint creation" usebundle => rudder_common_reports_generic("fstabConfiguration", "create_mountpoint_${fstab_index}", "${fstab[${fstab_index}][uuid]", "COMPONENT NAME", "None", "Created the mount point"), ifvarclass => "create_mountpoint_${fstab_index}"; "no action needed" usebundle => rudder_common_report("fstabConfiguration", "result_success", "${fstab[${fstab_index}][uuid]", "COMPONENT NAME", "None", "Created the mount point"), ifvarclass => "!create_mountpoint_${fstab_index}";Please note that I'm not sure what you would like to do for mounting. You have two choices:
- mount all if anything change (so the checkbox will be a bit misleading)
- check at every run if the selected mount point are mounted with /bin/mount | grep mountpoint , and if not mount it (resource intensive)
Updated by Anonymous over 6 years ago
- Tracker changed from User story to Architecture
- Subject changed from The fstab technique should mount file systems to Personalessay for students
- Description updated (diff)
- Category changed from Techniques to Server components
- Status changed from New to Rejected
- Assignee set to Dennis Cabooter
- Target version changed from Ideas (not version specific) to 4.3.5
Updated by Vincent MEMBRÉ over 6 years ago
- Tracker changed from Architecture to User story
- Subject changed from Personalessay for students to The fstab technique should mount file system
- Description updated (diff)
- Category changed from Server components to Techniques
- Status changed from Rejected to New
- Target version changed from 4.3.5 to Ideas (not version specific)
Fixed back the issue, anonymous are prevented again from doing any modifications
Updated by Alexis Mousset almost 3 years ago
This won’t be added to that technique, please use the technique editor for that. If you are missing some capabilities in it, please open a ticket for that need.
Updated by Alexis Mousset almost 3 years ago
- Status changed from New to Rejected