summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2011-02-19 17:08:19 +0100
committermh <mh@immerda.ch>2011-02-19 17:08:19 +0100
commit7b91e8e32fe337dae802cf9d6cbaa4092ae497ac (patch)
treef1ecc567ed795d2bc9bf91e653d5148d1bf426c5
parent1d9eeaba5f14172a685e3c1c34c0f7b4fd45ce34 (diff)
rearrange some variable setting
-rw-r--r--manifests/service.pp20
1 files changed, 6 insertions, 14 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
index ffbbc72..afc8650 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -10,7 +10,7 @@ define nagios::service (
$notification_period = '',
$notification_options = '',
$contact_groups = '',
- $use = 'absent',
+ $use = 'generic-service',
$service_description = 'absent' )
{
@@ -22,7 +22,12 @@ define nagios::service (
ensure => $ensure,
check_command => $check_command,
host_name => $host_name,
+ use => $use,
notify => Service[nagios],
+ service_description => $service_description ?{
+ 'absent' => $name,
+ default => $service_description
+ }
}
if ($check_period != '') {
@@ -56,18 +61,5 @@ define nagios::service (
if ($contact_groups != '') {
Nagios_service["${real_name}"] { contact_groups => $contact_groups }
}
-
- if ($use == 'absent') {
- Nagios_service["${real_name}"] { use => 'generic-service' }
- } else {
- Nagios_service["${real_name}"] { use => $use }
- }
-
- if ($service_description == 'absent') {
- Nagios_service["${real_name}"] { service_description => $name }
- } else {
- Nagios_service["${real_name}"] { service_description => $service_description }
- }
-
}