diff --git a/data/defaults.yaml b/data/defaults.yaml index 7889799f1..656ea47f5 100644 --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -163,7 +163,7 @@ prometheus::rabbitmq_exporter::package_ensure: 'latest' prometheus::rabbitmq_exporter::package_name: 'rabbitmq_exporter' prometheus::rabbitmq_exporter::service_name: 'rabbitmq_exporter' prometheus::rabbitmq_exporter::user: 'rabbitmq-exporter' -prometheus::rabbitmq_exporter::version: '0.25.2' +prometheus::rabbitmq_exporter::version: '0.29.0' prometheus::rabbitmq_exporter::rabbit_url: 'http://localhost:15672' prometheus::rabbitmq_exporter::rabbit_user: 'guest' prometheus::rabbitmq_exporter::rabbit_password: 'guest' diff --git a/spec/acceptance/rabbitmq_exporter_spec.rb b/spec/acceptance/rabbitmq_exporter_spec.rb new file mode 100644 index 000000000..75f67a7a1 --- /dev/null +++ b/spec/acceptance/rabbitmq_exporter_spec.rb @@ -0,0 +1,66 @@ +require 'spec_helper_acceptance' + +describe 'prometheus rabbitmq_exporter' do + it 'rabbitmq_exporter works idempotently with no errors' do + pp = <<-EOS + class { 'prometheus::rabbitmq_exporter': + extra_env_vars => { + 'PUBLISH_PORT' => '9419', + }, + scrape_port => 9419, + } + EOS + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe 'prometheus rabbitmq_exporter version 0.25.2' do + it 'rabbitmq_exporter installs with version 0.25.2' do + pp = <<-EOS + class { 'prometheus::rabbitmq_exporter': + version => '0.25.2', + extra_env_vars => { + 'PUBLISH_PORT' => '9419', + }, + scrape_port => 9419, + } + EOS + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('rabbitmq_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + + describe port(9090) do + it { is_expected.to be_listening.with('tcp6') } + end + end + + describe 'prometheus rabbitmq_exporter version 0.29.0' do + it 'rabbitmq_exporter installs with version 0.29.0' do + pp = <<-EOS + class { 'prometheus::rabbitmq_exporter': + version => '0.29.0', + extra_env_vars => { + 'PUBLISH_PORT' => '9419', + }, + scrape_port => 9419, + } + EOS + apply_manifest(pp, catch_failures: true) + apply_manifest(pp, catch_changes: true) + end + + describe service('rabbitmq_exporter') do + it { is_expected.to be_running } + it { is_expected.to be_enabled } + end + + describe port(9090) do + it { is_expected.to be_listening.with('tcp6') } + end + end +end