Skip to content

Commit

Permalink
Add possibilty to have a different resourcename and servicename
Browse files Browse the repository at this point in the history
FIX: Allow to export services and collect all on master
  • Loading branch information
Reamer committed Dec 8, 2016
1 parent f38a20b commit 2451bd9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions manifests/object/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
#

define icinga2::object::service (
$service_name = $title,
$ensure = present,
$display_name = undef,
$host_name = undef,
Expand Down Expand Up @@ -177,6 +178,7 @@
validate_absolute_path($target)
validate_string($order)

if $service_name { validate_string($service_name) }
if $display_name { validate_string ($display_name) }
validate_string($host_name)
if $groups { validate_array ($groups) }
Expand Down Expand Up @@ -209,7 +211,7 @@
$attrs = {
'display_name' => $display_name ,
'host_name' => $host_name ,
'name' => $name ,
'name' => $service_name ,
'groups' => $groups ,
'vars' => $vars ,
'check_command' => $check_command ,
Expand Down Expand Up @@ -239,7 +241,7 @@
# create object
icinga2::object { "icinga2::object::Service::${title}":
ensure => $ensure,
object_name => $name,
object_name => $service_name,
object_type => 'Service',
import => $import,
apply => $apply,
Expand Down

0 comments on commit 2451bd9

Please sign in to comment.