From 4325e15b00e460d3f0b82b1b6bc0d11a5bf0278e Mon Sep 17 00:00:00 2001 From: Ansgar Wiechers Date: Thu, 19 Oct 2023 13:57:06 +0200 Subject: [PATCH 1/4] Allow overriding the name of the exporter binary. --- manifests/mongodb_exporter.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/mongodb_exporter.pp b/manifests/mongodb_exporter.pp index 7bfa04097..79c8f7b94 100644 --- a/manifests/mongodb_exporter.pp +++ b/manifests/mongodb_exporter.pp @@ -3,6 +3,8 @@ # Architecture (amd64 or i386) # @param bin_dir # Directory where binaries are located +# @param bin_name +# The name of the binary to execute # @param cnf_uri # The URI to obtain MongoDB stats from # @param download_extension @@ -81,6 +83,7 @@ Optional[Prometheus::Uri] $download_url = undef, String[1] $arch = $prometheus::real_arch, Stdlib::Absolutepath $bin_dir = $prometheus::bin_dir, + String[1] $bin_name = 'mongodb_exporter', Boolean $export_scrape_job = false, Optional[Stdlib::Host] $scrape_host = undef, Stdlib::Port $scrape_port = 9216, @@ -118,6 +121,7 @@ arch => $arch, real_download_url => $real_download_url, bin_dir => $bin_dir, + bin_name => $bin_name, archive_bin_path => $archive_bin_path, notify_service => $notify_service, package_name => $package_name, From c7899dd0911e94cc15e232dcd6c5a3c053b6e9f1 Mon Sep 17 00:00:00 2001 From: Ansgar Wiechers Date: Thu, 19 Oct 2023 13:59:41 +0200 Subject: [PATCH 2/4] Use $service_name for the daemon resource namevar to avoid name mismatches. --- manifests/mongodb_exporter.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/mongodb_exporter.pp b/manifests/mongodb_exporter.pp index 79c8f7b94..7e9cc8ace 100644 --- a/manifests/mongodb_exporter.pp +++ b/manifests/mongodb_exporter.pp @@ -113,7 +113,7 @@ $options = "${flag_prefix}mongodb.uri=${cnf_uri} ${extra_options}" - prometheus::daemon { 'mongodb_exporter': + prometheus::daemon { $service_name: install_method => $install_method, version => $version, download_extension => $download_extension, From 1903da6919f2b39d30be115976ffe6db4f697ba9 Mon Sep 17 00:00:00 2001 From: Ansgar Wiechers Date: Thu, 2 Nov 2023 07:04:41 +0100 Subject: [PATCH 3/4] update documentation on mongodb_exporter class with the added parameter bin_name --- REFERENCE.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index b87067ff2..3a2434974 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -6224,6 +6224,7 @@ The following parameters are available in the `prometheus::mongodb_exporter` cla * [`arch`](#-prometheus--mongodb_exporter--arch) * [`bin_dir`](#-prometheus--mongodb_exporter--bin_dir) +* [`bin_name`](#-prometheus--mongodb_exporter--bin_name) * [`cnf_uri`](#-prometheus--mongodb_exporter--cnf_uri) * [`download_extension`](#-prometheus--mongodb_exporter--download_extension) * [`download_url`](#-prometheus--mongodb_exporter--download_url) @@ -6271,6 +6272,14 @@ Directory where binaries are located Default value: `$prometheus::bin_dir` +##### `bin_name` + +Data type: `String[1]` + +Name of the binary to execute + +Default value: `'mongodb_exporter'` + ##### `cnf_uri` Data type: `String[1]` From c88de752d4e46503ef97ea9c4ad931e1f54292a3 Mon Sep 17 00:00:00 2001 From: Ansgar Wiechers Date: Thu, 2 Nov 2023 13:46:10 +0100 Subject: [PATCH 4/4] auto-generated reference file --- REFERENCE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 3a2434974..e09ce39c9 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -6276,7 +6276,7 @@ Default value: `$prometheus::bin_dir` Data type: `String[1]` -Name of the binary to execute +The name of the binary to execute Default value: `'mongodb_exporter'`