On Fri, Apr 3, 2015 at 10:15 AM, Mitja Mihelič <[email protected]> wrote:

> Hi!
>
> I am trying to accomplish a seemigly simple task, currently without any
> success. And so multiple questions come to mind.
>
> A line in fstab should be checked each puppet runs and set it back to it's
> predefined state.
> gluster1:/gvol   /mnt/gluster    glusterfs defaults,transport=tcp,backup-
> volfile-servers=gluster2:gluster3  0 0
>
> This should change the mountpoint (file) value back to whatever was set in
> $mountpoint.
>         augeas { "gluster-fstab-mod-mountpoint":
>                 context => "/files/etc/fstab",
>                 changes => [
>                         "set *[file = '/mnt/gluster']/file '$mountpoint'",
>                 ],
>                 onlyif => [
>                         "match *[spec = '$server:/$volume']",
>                         "match *[file = '$mountpoint']",
>                         "match *[vfstype = 'glusterfs']",
>                 ]
>         }
> I could do this by having such a block for each of the options (spec,
> file, vfstype). Can it be done any other way?
>
> How do I go about changing the mount options (
> defaults,transport=tcp,backup-volfile-servers=gluster2:gluster3)?
> If someone adds options to /etc/fstab manually, I'd like to remove them.
> If options are changed, I'd like to reset them. If deleted, add them.
> How can I do that?
>
>
Mitja -

Can you use the native mount type (
https://docs.puppetlabs.com/references/latest/type.html#mount) for this? If
you manage all mount points using puppet's mount type and then enable purge
on mount resources (dangerous! test first - not in production) it should do
what you're looking for, if I understand what you're looking to accomplish.


-- 
Daniel Dreier
Technical Operations Engineer
GPG: BA4379FD

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAGk8suZxRdwB%2BNO%3DLweq3%2BizFsoCJw7TxVtnLMck_%3DtP2dfk6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to