Skip to content

Instantly share code, notes, and snippets.

@pmauduit
Created April 22, 2015 14:55
Show Gist options
  • Save pmauduit/1f6759f93c7959b20ff2 to your computer and use it in GitHub Desktop.
Save pmauduit/1f6759f93c7959b20ff2 to your computer and use it in GitHub Desktop.
puppet augeas sample (tweaking tomcat config)
define tomcat::property (
$ensure = 'present',
$key = $name,
$target,
$value,
) {
case $ensure {
'present': {
$changes = "set ${key} '${value}'"
}
'absent': {
$changes = "rm ${key}"
}
default: {
fail "\$ensure must be 'present' or 'absent'."
}
}
augeas { "Set ${key} property in ${target}":
incl => $target,
lens => 'Properties.lns',
changes => $changes,
}
}
class georchestra {
file { ['/tmp/geonetwork', '/tmp/geonetwork/WEB-INF']:
ensure => directory;
} ->
georchestra::webapp {
'ROOT':;
'geonetwork': webapp_path => '/tmp';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment