Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
$management_ssl = true
$package_apt_pin = ''
$package_gpg_key = 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc'
$repos_ensure = true
$repos_ensure = false
$manage_repos = undef
$service_ensure = 'running'
$service_manage = true
Expand Down
11 changes: 7 additions & 4 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

context 'on Debian' do
with_debian_facts
let(:params) {{ :repos_ensure => true }}
it 'includes rabbitmq::repo::apt' do
should contain_class('rabbitmq::repo::apt')
end
Expand All @@ -37,7 +38,7 @@
end

context 'on Debian' do
let(:params) {{ :manage_repos => true }}
let(:params) {{ :manage_repos => true, :repos_ensure => true }}
with_debian_facts

it 'includes rabbitmq::repo::apt' do
Expand Down Expand Up @@ -182,6 +183,7 @@

context 'on Redhat' do
with_redhat_facts
let(:params) {{ :repos_ensure => true }}
it 'includes rabbitmq::repo::rhel' do
should contain_class('rabbitmq::repo::rhel')
should contain_exec('rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc')
Expand Down Expand Up @@ -282,9 +284,9 @@
end

context 'on Redhat' do
let(:params) {{ :manage_repos => true }}
let(:params) {{ :manage_repos => true, :repos_ensure => true }}
with_redhat_facts
it 'does import repo public key when manage_repos is true' do
it 'does import repo public key when manage_repos and repos_ensure are true' do
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note this change. If you disagree with it, then it may be needed to look again at the logic in init.pp, as that checks for manage_repos != false as the condition to include repo class. Since this parameter is itself deprecated, it seems to me this logic should change, though it is not a requirement for this patch.

should contain_class('rabbitmq::repo::rhel')
should contain_exec('rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc')
end
Expand Down Expand Up @@ -1419,7 +1421,8 @@
describe "repo management on #{distro}" do
describe 'imports the key' do
let(:facts) { osfacts }
let(:params) {{ :package_gpg_key => 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' }}
let(:params) {{ :package_gpg_key => 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc',
:manage_repos => true, :repos_ensure => true }}

it { should contain_exec("rpm --import #{params[:package_gpg_key]}").with(
'path' => ['/bin','/usr/bin','/sbin','/usr/sbin']
Expand Down