with augtool you can do the following: augtool> ls /files/etc/fstab/3/ spec = UUID=XXXX file = /boot/efi vfstype = vfat opt[1]/ = umask opt[2]/ = shortname dump = 0 passno = 0 augtool> *rm /files/etc/fstab/3/opt[*]* rm : /files/etc/fstab/3/opt[*] 4 augtool> ls /files/etc/fstab/3/ spec = UUID=XXXX file = /boot/efi vfstype = vfat dump = 0 passno = 0 augtool>
I believe in the augeas resource you can do "rm opt[*]" for the same result. I'd be sure you have a backup of the file before doing this on a real box :) On Wednesday, 4 February 2015 15:15:29 UTC, Anthony Clark wrote: > > Hello All, > > I have a requirement to mount /var with specific options if mysql-server > is installed and the filesystem is ext4. So far I have this: > > if defined(Package['mysql55-server']) { > notice "found mysql server" > > augeas { 'fstabvarentry': > context => '/files/etc/fstab/*[file="/var"][vfstype="ext4"]', > changes => [ > '', # remove all opt nodes > 'ins opt[1] "defaults"', > 'ins opt[2] "noatime"', > # etc etc to build > "defaults,noatime,data=writeback,barrier=0,nobh,errors=remount-ro" > ], > onlyif => 'match /files/etc/fstab/*[file="/var"][vfstype="ext4"]', > } > } > > Now, my problem is how to deal with all possible opt entries for the /var > partition. I want to start off by removing *all* opt nodes then adding the > ones I need, but I am having trouble finding the syntax on how to remove > all opt nodes. > > How can I write "rm opt*" ? > > Thanks! > -- 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 puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/beba8a33-ffb2-4c43-b99f-d9f30bf9f460%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.