include apache2
- if ! ($config or $template) {
- err ( "No configuration found for ${name}" )
- }
-
case $ensure {
- present: {}
+ present: {
+ if ! ($config or $template) {
+ fail ( "No configuration found for ${name}" )
+ }
+ }
absent: {}
- default: { err ( "Unknown ensure value: '$ensure'" ) }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
if $template {
notify => Service['apache2']
}
}
- default: { err ( "Unknown ensure value: '$ensure'" ) }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
}
include apache2
- if ! ($config or $template) {
- err ( "No configuration found for ${name}" )
+ if $ensure == present {
+ if ! ($config or $template) {
+ fail ( "No configuration found for ${name}" )
+ }
}
if $site {
$link_target = $ensure ? {
present => $target,
absent => absent,
- default => err ( "Unknown ensure value: '$ensure'" ),
+ default => fail ( "Unknown ensure value: '$ensure'" ),
}
case $template {
$link_target = $ensure ? {
present => "/usr/share/munin/plugins/${link}",
absent => absent,
- default => err ( "Unknown ensure value: '$ensure'" ),
+ default => fail ( "Unknown ensure value: '$ensure'" ),
}
file { "/etc/munin/plugins/${name}":
unless => "[ $(update-alternatives --query ${name} | grep ^Value | awk '{print \$2}') != ${linkto} ]",
}
}
- default: { err ( "Unknown ensure value: '$ensure'" ) }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
}
case $ensure {
present: {}
absent: {}
- default: { err ( "Unknown ensure value: '$ensure'" ) }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
- if ! ($template or $config) {
- err ( "Can't find configuration for ${name}" )
+ if $ensure == present {
+ if ! ($config or $template) {
+ fail ( "No configuration found for ${name}" )
+ }
}
if $template {
onlyif => "grep -q -F -x '${name}' /etc/modules",
}
}
- default: {
- err("invalid ensure value ${ensure}")
- }
+ default: { fail ("invalid ensure value ${ensure}") }
}
}
}
case $ensure {
present: {}
absent: {}
- default: { err ( "Unknown ensure value: '$ensure'" ) }
+ default: { fail ( "Unknown ensure value: '$ensure'" ) }
}
file {