Skip to content

Instantly share code, notes, and snippets.

@raphink
Created August 3, 2012 18:06
Show Gist options
  • Save raphink/3250078 to your computer and use it in GitHub Desktop.
Save raphink/3250078 to your computer and use it in GitHub Desktop.
define automaster::option ($mountpoint, $value, $file='/etc/auto.master', $ensure='present') {
case $ensure {
present: {
augeas {"Set auto.master option ${name} on mountpoint ${mountpoint}":
context => "/files${file}",
changes => "set *[. = '${mountpoint}']/opt[. = '${name}'] '$value'",
}
}
absent: {
augeas {"Remove auto.master option ${name} on mountpoint ${mountpoint}":
context => "/files${file}",
changes => "rm *[. = '${mountpoint}']/opt[. = '${name}']",
}
}
default: { fail("Wrong value for ensure: ${ensure}") }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment