Skip to content

Commit

Permalink
[issue-680] make statsd exporter mappings optional
Browse files Browse the repository at this point in the history
  • Loading branch information
chadh committed May 5, 2024
1 parent 5dc551e commit b10b872
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions manifests/statsd_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
String[1] $package_ensure,
String[1] $package_name,
String[1] $service_name,
Array[Hash] $mappings,
String[1] $user,
String[1] $version,
Optional[Array[Hash]] $mappings = undef,
String[1] $arch = $prometheus::real_arch,
Stdlib::Absolutepath $bin_dir = $prometheus::bin_dir,
String[1] $config_mode = $prometheus::config_mode,
Expand Down Expand Up @@ -105,13 +105,15 @@
default => undef,
}

file { $mapping_config_path:
ensure => 'file',
mode => $config_mode,
owner => 'root',
group => $group,
content => stdlib::to_yaml({ mappings => $mappings }),
notify => $notify_service,
if $mappings {
file { $mapping_config_path:
ensure => 'file',
mode => $config_mode,
owner => 'root',
group => $group,
content => stdlib::to_yaml({ mappings => $mappings }),
notify => $notify_service,
}
}

# Switched to POSIX like flags in version 0.7.0
Expand Down

0 comments on commit b10b872

Please sign in to comment.