Skip to content

Instantly share code, notes, and snippets.

@andrewkroh
Created Aug 9, 2014
Embed
What would you like to do?
Configuring /etc/fstab with Puppet Augeas
augeas{ '/etc/fstab - nosuid on /sys':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/sys']/opt[last()]",
"set *[file = '/sys']/opt[last()] nosuid",
],
onlyif => "match *[file = '/sys']/opt[. = 'nosuid'] size == 0",
}
augeas{ '/etc/fstab - acl on /sys':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/sys']/opt[last()]",
"set *[file = '/sys']/opt[last()] acl",
],
onlyif => "match *[file = '/sys']/opt[. = 'acl'] size == 0",
}
augeas{ '/etc/fstab - nosuid on /boot':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/boot']/opt[last()]",
"set *[file = '/boot']/opt[last()] nosuid",
],
onlyif => "match *[file = '/boot']/opt[. = 'nosuid'] size == 0",
}
augeas{ '/etc/fstab - acl on /boot':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/boot']/opt[last()]",
"set *[file = '/boot']/opt[last()] acl",
],
onlyif => "match *[file = '/boot']/opt[. = 'acl'] size == 0",
}
augeas{ '/etc/fstab - nodev on /boot':
context => "/files/etc/fstab",
changes => [
"ins opt after /files/etc/fstab/*[file = '/boot']/opt[last()]",
"set *[file = '/boot']/opt[last()] nodev",
],
onlyif => "match *[file = '/boot']/opt[. = 'nodev'] size == 0",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment