Showing with 56 additions and 2 deletions.
  1. +9 −0 CHANGELOG.md
  2. +8 −1 manifests/process_exporter.pp
  3. +1 −1 metadata.json
  4. +38 −0 spec/classes/process_exporter_spec.rb
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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.5](https://github.com/voxpupuli/puppet-prometheus/tree/v6.0.5) (2018-06-23)

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

**Fixed bugs:**

- The real\_download\_url in process-exporter manifest doesn't match to newer versions [\#212](https://github.com/voxpupuli/puppet-prometheus/issues/212)
- fix support for process\_exporter 0.2.0 and newer [\#220](https://github.com/voxpupuli/puppet-prometheus/pull/220) ([tuxmea](https://github.com/tuxmea))

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

[Full Changelog](https://github.com/voxpupuli/puppet-prometheus/compare/v6.0.3...v6.0.4)
Expand Down
9 changes: 8 additions & 1 deletion manifests/process_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@
Stdlib::Absolutepath $bin_dir = $prometheus::bin_dir,
) inherits prometheus {

$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${package_name}-${version}.${os}-${arch}.${download_extension}")
# Prometheus removed a dot on the realease name at 0.2.0
if versioncmp ($version, '0.2.0') >= 0 {
$filename = "${package_name}-${version}${os}_${arch}.${download_extension}"
}
else {
$filename = "${package_name}-${version}.${os}-${arch}.${download_extension}"
}
$real_download_url = pick($download_url,"${download_url_base}/download/v${version}/${filename}")
$notify_service = $restart_on_change ? {
true => Service['process-exporter'],
default => undef,
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.4",
"version": "6.0.5",
"author": "Vox Pupuli",
"summary": "This module installs, configures and manages the Prometheus service.",
"license": "Apache-2.0",
Expand Down
38 changes: 38 additions & 0 deletions spec/classes/process_exporter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'spec_helper'

describe 'prometheus::process_exporter' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge(os_specific_facts(facts))
end

context 'without parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('prometheus') }
it { is_expected.to contain_user('process-exporter') }
it { is_expected.to contain_group('process-exporter') }
it { is_expected.to contain_prometheus__daemon('process-exporter').with(options: '-config.path=/etc/process-exporter.yaml ') }
it { is_expected.to contain_service('process-exporter') }
end

context 'with version specified' do
let(:params) do
{
version: '0.2.4',
arch: 'amd64',
os: 'linux',
bin_dir: '/usr/local/bin',
install_method: 'url'
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_archive('/tmp/process-exporter-0.2.4.tar.gz') }
describe 'install correct binary' do
it { is_expected.to contain_file('/usr/local/bin/process-exporter').with('target' => '/opt/process-exporter-0.2.4.linux-amd64/process-exporter') }
end
end
end
end
end