Skip to content

Commit

Permalink
Merge pull request voxpupuli#49 from sathieu/default_collectors
Browse files Browse the repository at this point in the history
Use default collectors if "collectors" param is empty
  • Loading branch information
bastelfreak committed Sep 24, 2017
2 parents f0c8368 + 7f2bd40 commit 4288526
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions manifests/node_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Directory where binaries are located
#
# [*collectors*]
# The set of node node_exporter collectors
# The set of node node_exporter collectors. Use default collectors if empty.
#
# [*download_extension*]
# Extension for the release binary archive
Expand Down Expand Up @@ -119,8 +119,12 @@
default => undef,
}

$str_collectors = join($collectors, ',')
$options = "-collectors.enabled=${str_collectors} ${extra_options}"
if empty($collectors) {
$options = $extra_options
} else {
$str_collectors = join($collectors, ',')
$options = "-collectors.enabled=${str_collectors} ${extra_options}"
}

prometheus::daemon { $service_name :
install_method => $install_method,
Expand Down

0 comments on commit 4288526

Please sign in to comment.