Skip to content

Instantly share code, notes, and snippets.

@andrewkroh
Created August 9, 2014 16:55
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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