diff --git a/manifests/init.pp b/manifests/init.pp index 69e8b6b..abdc4e0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -25,6 +25,20 @@ # String. The config file's group. Should be pe_puppet for Puppet Enterprise. # Default: puppet # +# [*graphite_prefix*] +# String. Prefix added to the metric name before hostname. +# When set to undef of 'absent' it's not added to config file. +# Default: undef +# +# [*graphite_suffix*] +# String. Suffix added to the metric name after hostname. +# When set to undef of 'absent' it's not added to config file. +# Default: 'puppet' +# +# [*graphite_reverse_hostname*] +# Boolean. When true the hostname is reversed in metric name. +# Default: true +# # # === Examples # diff --git a/templates/graphite.yaml.erb b/templates/graphite.yaml.erb index 3f66094..f4833eb 100644 --- a/templates/graphite.yaml.erb +++ b/templates/graphite.yaml.erb @@ -1,6 +1,10 @@ --- :graphite_server: <%= scope.lookupvar('graphite_host') %> :graphite_port: <%= scope.lookupvar('graphite_port') %> +<% if ![nil, :undef, 'absent'].include?(scope.lookupvar('graphite_prefix')) -%> :graphite_prefix: <%= scope.lookupvar('graphite_prefix') %> +<% end -%> +<% if ![nil, :undef, 'absent'].include?(scope.lookupvar('graphite_suffix')) -%> :graphite_suffix: <%= scope.lookupvar('graphite_suffix') %> +<% end -%> :graphite_reverse_hostname: <%= scope.lookupvar('graphite_reverse_hostname') %>