Hi there,
I'm trying to add the nobarrier option to our XFS mount options in /etc/fstab using Augeas. I've tried this:
augeas { 'fstabxfsnobarrier':
context => '/files/etc/fstab',
changes => [
'rm /*[vfstype="xfs"]/opt',
'ins opt after vfstype="xfs"',
'set /*[vfstype="xfs"]/opt[last()] "defaults"',
'ins opt after vfstype="xfs"',
'set /*[vfstype="xfs"]/opt[last()] "nobarrier"',
],
}
But that isn't working. Now in the past I've done something similar with ext4 and /var, which does work:
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"',
],
}
}
Can Augeas only edit one line at a time, i.e. am I not allowed to do "add this option to every matching line"?
Any help would be greatly appreciated!
Anthony