Created
July 7, 2015 14:21
-
-
Save raphink/79e720badc8e69859100 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 java::property ( | |
$ensure = 'present', | |
$value = undef, | |
$target, | |
) { | |
case $ensure { | |
'present': { | |
$changes = "set ${name} ${value}" | |
} | |
'absent': { | |
$changes = "rm ${name}" | |
} | |
default: { | |
fail "Wrong value for \$ensure: ${ensure}" | |
} | |
} | |
augeas { "java property ${name} in ${target}": | |
incl => $target, | |
lens => 'Properties.lns', | |
changes => $changes, | |
} | |
} | |
java::property { 'some.key': | |
value => 'foo', | |
target => '/tmp/test.properties', | |
} | |
java::property { 'somekey': | |
ensure => absent, | |
target => '/tmp/test.properties', | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment