Running the following gives me an error: augeas { 'fstabvarentry': context => '/files/etc/fstab/*[file="/var"][vfstype="ext4"]', changes => [ 'set opt[1] "default"', 'set opt[2] "noatime"', 'set opt[3] "data"', 'set opt[3]/value "writeback"', 'set opt[4] "barrier"', 'set opt[4]/value "0"', 'set opt[5] "nobh"', 'set opt[6] "errors"', 'set opt[6]/value "remount-ro"', ], #onlyif => 'match /files/etc/fstab/*[file="/var"][vfstype="ext4"]', }
Debug: Augeas[fstabvarentry](provider=augeas): /augeas/files/etc/fstab/error /message = Failed to match { /spec/ = /[^\001-\004\t\n #,][^\001-\004\t\n ]*/ }{ /file/ = /[^\001-\004\t\n #]+/ }{ /vfstype/ = /[^\001-\004\t\n #,=]+/ }({ /vfstype/ = /[^\001-\004\t\n #,=]+/ })*({ /opt/ = /[^\001-\004\t\n #,=]+/ }({ /opt/ = /[^\001-\004\t\n #,=]+/ })*({ /dump/ = /[0-9]+/ }({ /passno/ = /[0-9]+/ })?)?)?({ /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ } | ()) with tree { "spec" = "/dev/mapper/vg_01-lv_var01" } { "file" = "/var" } { "vfstype" = "ext4" } { "opt" = "default" } { "dump" = "1" } { "passno" = "2" } { "opt" = "noatime" } { "opt" = "data" } { "opt" = "barrier" } { "opt" = "nobh" } { "opt" = "errors" } Debug: Augeas[fstabvarentry](provider=augeas): Closed the augeas connection Error: /Stage[main]/Wnp::Fusion::Mysql_server55/Augeas[fstabvarentry]: Could not evaluate: Saving failed, see debug On Wednesday, February 4, 2015 at 10:15:29 AM UTC-5, 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/3244a696-aeef-43bb-8bc7-7180de45131f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.