Showing with 37 additions and 5 deletions.
  1. +12 −0 CHANGELOG.md
  2. +5 −4 manifests/redis_exporter.pp
  3. +1 −1 metadata.json
  4. +19 −0 spec/acceptance/redis_exporter_spec.rb
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v6.0.3](https://github.com/voxpupuli/puppet-prometheus/tree/v6.0.3) (2018-06-21)

[Full Changelog](https://github.com/voxpupuli/puppet-prometheus/compare/v6.0.2...v6.0.3)

**Fixed bugs:**

- use service name for redis\_exporter to prevent multiple downloads of redis\_exporter [\#216](https://github.com/voxpupuli/puppet-prometheus/pull/216) ([blupman](https://github.com/blupman))

**Closed issues:**

- redis\_exporter is downloaded every puppet run [\#215](https://github.com/voxpupuli/puppet-prometheus/issues/215)

## [v6.0.2](https://github.com/voxpupuli/puppet-prometheus/tree/v6.0.2) (2018-06-19)

[Full Changelog](https://github.com/voxpupuli/puppet-prometheus/compare/v6.0.1...v6.0.2)
Expand Down
9 changes: 5 additions & 4 deletions manifests/redis_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
# redis_exporter lacks.
# TODO: patch prometheus::daemon to support custom extract directories
$exporter_install_method = 'none'
file { "/opt/${service_name}-${version}.${os}-${arch}":
$install_dir = "/opt/${service_name}-${version}.${os}-${arch}"
file { $install_dir:
ensure => 'directory',
owner => 'root',
group => 0, # 0 instead of root because OS X uses "wheel".
Expand All @@ -135,16 +136,16 @@
-> archive { "/tmp/${service_name}-${version}.${download_extension}":
ensure => present,
extract => true,
extract_path => "/opt/${service_name}-${version}.${os}-${arch}",
extract_path => $install_dir,
source => $real_download_url,
checksum_verify => false,
creates => "/opt/${name}-${version}.${os}-${arch}/${name}",
creates => "${install_dir}/${service_name}",
cleanup => true,
}
-> file { "${bin_dir}/${service_name}":
ensure => link,
notify => $notify_service,
target => "/opt/${service_name}-${version}.${os}-${arch}/${service_name}",
target => "${install_dir}/${service_name}",
before => Prometheus::Daemon[$service_name],
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-prometheus",
"version": "6.0.2",
"version": "6.0.3",
"author": "Vox Pupuli",
"summary": "This module installs, configures and manages the Prometheus service.",
"license": "Apache-2.0",
Expand Down
19 changes: 19 additions & 0 deletions spec/acceptance/redis_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper_acceptance'

describe 'prometheus redis exporter' do
it 'redis_exporter works idempotently with no errors' do
pp = 'include prometheus::redis_exporter'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

describe service('redis_exporter') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
# the class installs an the redis_exporter that listens on port 9121
describe port(9121) do
it { is_expected.to be_listening.with('tcp6') }
end
end