Created
August 3, 2012 18:06
-
-
Save raphink/3250078 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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