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"]',
}
} 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
if defined(Package['mysql55-server']) {
augeas { 'fstabvarext4entry':
context => '/files/etc/fstab/*[file="/var"][vfstype="ext4"]',
changes => [
'rm opt',
'ins opt after vfstype[last()]',
'set opt[last()] "defaults"',
'ins opt after opt[last()]',
'set opt[last()] "noatime"',
'ins opt after opt[last()]',
'set opt[last()] "data"',
'set opt[last()]/value "writeback"',
'ins opt after opt[last()]',
'set opt[last()] "barrier"',
'set opt[last()]/value "0"',
'ins opt after opt[last()]',
'set opt[last()] "nobh"',
'ins opt after opt[last()]',
'set opt[last()] "errors"',
'set opt[last()]/value "remount-ro"',
],
}
}