From 4fa1812fbd7f1b3ee3ebef77f13bf2162938b833 Mon Sep 17 00:00:00 2001 From: Eric Zounes Date: Tue, 12 Jan 2016 14:29:40 -0800 Subject: [PATCH] Set template parameters to undef and don't create ini settings unless they're set. --- manifests/mod/graphite.pp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/manifests/mod/graphite.pp b/manifests/mod/graphite.pp index dce323c..2489ff9 100644 --- a/manifests/mod/graphite.pp +++ b/manifests/mod/graphite.pp @@ -5,8 +5,8 @@ class icingaweb2::mod::graphite ( $git_revision = undef, $graphite_base_url = 'http://graphite.com/render?', $graphite_metric_prefix = undef, - $service_name_template = 'icinga2.$host.name$.services.$service.name$.$service.check_command$.perfdata.$metric$.value', - $host_name_template = 'icinga2.$host.name$.host.$host.check_command$.perfdata.$metric$.value', + $service_name_template = undef, + $host_name_template = undef, $install_method = 'git', $pkg_deps = undef, $pkg_ensure = 'present', @@ -58,16 +58,20 @@ class icingaweb2::mod::graphite ( } } - ini_setting { 'service_name_template': - section => 'graphite', - setting => 'service_name_template', - value => $service_name_template, + if $service_name_template { + ini_setting { 'service_name_template': + section => 'graphite', + setting => 'service_name_template', + value => $service_name_template, + } } - ini_setting { 'host_name_template': - section => 'graphite', - setting => 'host_name_template', - value => $host_name_template, + if $host_name_template { + ini_setting { 'host_name_template': + section => 'graphite', + setting => 'host_name_template', + value => $host_name_template, + } }