On Fri, Apr 03, 2015 at 11:40:36AM -0700, Daniel Dreier wrote: > On Fri, Apr 3, 2015 at 10:15 AM, Mitja Mihelič <[1][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 > ([2]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.
Quoth, "Puppet will try to unmount then remount that filesystem". This seems to be true for mount option changes in the resource too. The problem is that if there's a filehandle pointing into the filesystem the unmount will fail and the filesystem will keep its previous options. Some kind of 'mount -o remount,and,other,options' on resource changes rather than creation would have to be available through something other than the mount type. (Also, a remount,etc sort of provider seems to be asking for trouble, how will you know which filehandles' processes are safe to kill?) > -- > 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 [3][email protected]. > To view this discussion on the web visit > > [4]https://groups.google.com/d/msgid/puppet-users/CAGk8suZxRdwB%2BNO%3DLweq3%2BizFsoCJw7TxVtnLMck_%3DtP2dfk6g%40mail.gmail.com. > For more options, visit [5]https://groups.google.com/d/optout. > > References > > Visible links > 1. mailto:[email protected] > 2. https://docs.puppetlabs.com/references/latest/type.html#mount > 3. mailto:[email protected] > 4. > https://groups.google.com/d/msgid/puppet-users/CAGk8suZxRdwB%2BNO%3DLweq3%2BizFsoCJw7TxVtnLMck_%3DtP2dfk6g%40mail.gmail.com?utm_medium=email&utm_source=footer > 5. https://groups.google.com/d/optout -- 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/20150404051302.GB3509%40iniquitous.heresiarch.ca. For more options, visit https://groups.google.com/d/optout.
