diff --git a/data/defaults.yaml b/data/defaults.yaml index 968e418af..7889799f1 100644 --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -301,7 +301,14 @@ prometheus::graphite_exporter::package_ensure: 'latest' prometheus::graphite_exporter::package_name: 'graphite_exporter' prometheus::graphite_exporter::service_name: 'graphite_exporter' prometheus::graphite_exporter::user: 'graphite-exporter' -prometheus::graphite_exporter::version: '0.2.0' +prometheus::graphite_exporter::purge_config_dir: true +prometheus::graphite_exporter::restart_on_change: true +prometheus::graphite_exporter::service_enable: true +prometheus::graphite_exporter::service_ensure: 'running' +prometheus::graphite_exporter::manage_group: true +prometheus::graphite_exporter::manage_service: true +prometheus::graphite_exporter::manage_user: true +prometheus::graphite_exporter::version: '0.7.1' prometheus::graphite_exporter::options: '' prometheus::collectd_exporter::download_extension: 'tar.gz' prometheus::collectd_exporter::download_url_base: 'https://github.com/prometheus/collectd_exporter/releases' diff --git a/spec/acceptance/graphite_exporter_spec.rb b/spec/acceptance/graphite_exporter_spec.rb new file mode 100644 index 000000000..42f921734 --- /dev/null +++ b/spec/acceptance/graphite_exporter_spec.rb @@ -0,0 +1,48 @@ +require 'spec_helper_acceptance' + +describe 'prometheus graphite exporter' do + it 'graphite_exporter works idempotently with no errors' do + pp = 'include prometheus::graphite_exporter' + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('graphite_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + describe port(9109) do + it { is_expected.to be_listening.with('tcp6') } + end + + describe 'graphite_exporter update from 0.2.0 to 0.7.1' do + it 'is idempotent' do + pp = "class{'prometheus::graphite_exporter': version => '0.2.0'}" + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('graphite_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + + describe port(9109) do + it { is_expected.to be_listening.with('tcp6') } + end + it 'is idempotent' do + pp = "class{'prometheus::graphite_exporter': version => '0.7.1'}" + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('graphite_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + + describe port(9109) do + it { is_expected.to be_listening.with('tcp6') } + end + end +end diff --git a/spec/classes/graphite_exporter_spec.rb b/spec/classes/graphite_exporter_spec.rb index 46f80bb30..ec6350642 100644 --- a/spec/classes/graphite_exporter_spec.rb +++ b/spec/classes/graphite_exporter_spec.rb @@ -23,7 +23,7 @@ } end - it { is_expected.to contain_archive('/tmp/graphite_exporter-0.2.0.tar.gz') } + it { is_expected.to contain_archive('/tmp/graphite_exporter-0.7.1.tar.gz') } end end end