Skip to content

Instantly share code, notes, and snippets.

@andrewkroh
Created August 9, 2014 16:55
Show Gist options
  • Save andrewkroh/acc06c3f5490c93d95f6 to your computer and use it in GitHub Desktop.
Save andrewkroh/acc06c3f5490c93d95f6 to your computer and use it in GitHub Desktop.
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