Skip to content

Commit b10b872

Browse files
committed
[issue-680] make statsd exporter mappings optional
1 parent 5dc551e commit b10b872

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

manifests/statsd_exporter.pp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
String[1] $package_ensure,
6868
String[1] $package_name,
6969
String[1] $service_name,
70-
Array[Hash] $mappings,
7170
String[1] $user,
7271
String[1] $version,
72+
Optional[Array[Hash]] $mappings = undef,
7373
String[1] $arch = $prometheus::real_arch,
7474
Stdlib::Absolutepath $bin_dir = $prometheus::bin_dir,
7575
String[1] $config_mode = $prometheus::config_mode,
@@ -105,13 +105,15 @@
105105
default => undef,
106106
}
107107

108-
file { $mapping_config_path:
109-
ensure => 'file',
110-
mode => $config_mode,
111-
owner => 'root',
112-
group => $group,
113-
content => stdlib::to_yaml({ mappings => $mappings }),
114-
notify => $notify_service,
108+
if $mappings {
109+
file { $mapping_config_path:
110+
ensure => 'file',
111+
mode => $config_mode,
112+
owner => 'root',
113+
group => $group,
114+
content => stdlib::to_yaml({ mappings => $mappings }),
115+
notify => $notify_service,
116+
}
115117
}
116118

117119
# Switched to POSIX like flags in version 0.7.0

0 commit comments

Comments
 (0)