From c1ad948a75d44b1ccedfe1e59e3378e9acd83afd Mon Sep 17 00:00:00 2001 From: lconsuegra Date: Tue, 11 Aug 2020 16:57:10 +0200 Subject: [PATCH 1/3] prometheus::dellhw_exporter: Fix param download_url_base to avoid a 404 Not Found during installation --- manifests/dellhw_exporter.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/dellhw_exporter.pp b/manifests/dellhw_exporter.pp index c6c75092b..9627f89b6 100644 --- a/manifests/dellhw_exporter.pp +++ b/manifests/dellhw_exporter.pp @@ -49,7 +49,7 @@ # The file path to the omReport executable (default "/opt/dell/srvadmin/bin/omreport") class prometheus::dellhw_exporter ( String[1] $download_extension = 'tar.gz', - String[1] $download_url_base = 'https://github.com/galexrt/dellhw-exporter/releases', + String[1] $download_url_base = 'https://github.com/galexrt/dellhw_exporter/releases', Array[String] $extra_groups = [], String[1] $group = 'dellhw-exporter', String[1] $package_ensure = 'present', From 9a6c143b2a3a91c1eca39bccafa15cb4dc621a52 Mon Sep 17 00:00:00 2001 From: lconsuegra Date: Tue, 11 Aug 2020 17:24:52 +0200 Subject: [PATCH 2/3] prometheus::dellhw_exporter: Fix --web-listen-address flag syntax to avoid service fail at launch --- manifests/dellhw_exporter.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/dellhw_exporter.pp b/manifests/dellhw_exporter.pp index 9627f89b6..5d1c7c7a2 100644 --- a/manifests/dellhw_exporter.pp +++ b/manifests/dellhw_exporter.pp @@ -86,7 +86,7 @@ } $real_omreport_path = "--collectors-omreport=${omreport_path}" - $real_scrape_port = "--web-listen-address=${scrape_port}" + $real_scrape_port = "--web-listen-address=:${scrape_port}" $options = join([$extra_options, $real_omreport_path, $real_scrape_port], ' ') prometheus::daemon { $service_name: From eec8ec2a3eeacbfec283fbb17d42c32e85379f30 Mon Sep 17 00:00:00 2001 From: lconsuegra Date: Wed, 12 Aug 2020 11:12:53 +0200 Subject: [PATCH 3/3] prometheus::dellhw_exporter: Add acceptance test file --- spec/acceptance/dellhw_exporter_spec.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spec/acceptance/dellhw_exporter_spec.rb diff --git a/spec/acceptance/dellhw_exporter_spec.rb b/spec/acceptance/dellhw_exporter_spec.rb new file mode 100644 index 000000000..19182bf7f --- /dev/null +++ b/spec/acceptance/dellhw_exporter_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper_acceptance' + +describe 'prometheus dellhw_exporter' do + it 'dellhw_exporter works idempotently with no errors' do + pp = 'include prometheus::dellhw_exporter' + # Run it twice and test for idempotency + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('dellhw_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + + describe port(9137) do + it { is_expected.to be_listening.with('tcp6') } + end +end