Skip to content

Commit dca42e6

Browse files
committed
Re-enable repos_ensure by default
This re-enables repos_ensure by default so that the newer packages hosted in packagecloud are installed.
1 parent 1a1c6e7 commit dca42e6

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

data/family/RedHat.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2+
rabbitmq::python_package: 'python3'
23
rabbitmq::package_name: 'rabbitmq-server'
34
rabbitmq::service_name: 'rabbitmq-server'
45
rabbitmq::package_gpg_key: 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc'
5-
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
6+
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'

manifests/init.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
# Name of the package required by rabbitmqadmin.
239239
# @param repos_ensure
240240
# Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
241-
# Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
241+
# Defaults to true. This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
242242
# It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
243243
# different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788
244244
# @param service_ensure
@@ -377,7 +377,7 @@
377377
Variant[String, Array] $package_name = 'rabbitmq',
378378
Optional[String] $package_source = undef,
379379
Optional[String] $package_provider = undef,
380-
Boolean $repos_ensure = false,
380+
Boolean $repos_ensure = true,
381381
Boolean $manage_python = true,
382382
String $python_package = 'python',
383383
String $rabbitmq_user = 'rabbitmq',

spec/classes/rabbitmq_spec.rb

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
facts
1313
end
1414

15-
name = case facts[:osfamily]
15+
name = case facts[:os]['family']
1616
when 'Archlinux', 'OpenBSD', 'FreeBSD'
1717
'rabbitmq'
1818
else
@@ -29,21 +29,6 @@
2929
it { is_expected.to contain_package('rabbitmq-server-plugins') } if facts[:os]['family'] == 'Suse'
3030

3131
context 'with default params' do
32-
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
33-
it { is_expected.not_to contain_apt__source('rabbitmq') }
34-
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
35-
it { is_expected.not_to contain_yumrepo('rabbitmq') }
36-
end
37-
38-
context 'with service_restart => false' do
39-
let(:params) { { service_restart: false } }
40-
41-
it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') }
42-
end
43-
44-
context 'with repos_ensure => true' do
45-
let(:params) { { repos_ensure: true } }
46-
4732
if facts[:os]['family'] == 'Debian'
4833
it 'includes rabbitmq::repo::apt' do
4934
is_expected.to contain_class('rabbitmq::repo::apt').
@@ -78,8 +63,23 @@
7863
end
7964
end
8065

66+
context 'with service_restart => false' do
67+
let(:params) { { service_restart: false } }
68+
69+
it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') }
70+
end
71+
72+
context 'with repos_ensure => false' do
73+
let(:params) { { repos_ensure: false } }
74+
75+
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
76+
it { is_expected.not_to contain_apt__source('rabbitmq') }
77+
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
78+
it { is_expected.not_to contain_yumrepo('rabbitmq') }
79+
end
80+
8181
context 'with no pin', if: facts[:os]['family'] == 'Debian' do
82-
let(:params) { { repos_ensure: true, package_apt_pin: '' } }
82+
let(:params) { { package_apt_pin: '' } }
8383

8484
if Puppet.version =~ %r{^[6,7]} # https://tickets.puppetlabs.com/browse/PUP-9112 and https://tickets.puppetlabs.com/browse/PUP-9180
8585
let(:expected_key_apt_source_key_content) { 'nil' }
@@ -99,7 +99,7 @@
9999
end
100100

101101
context 'with pin', if: facts[:os]['family'] == 'Debian' do
102-
let(:params) { { repos_ensure: true, package_apt_pin: '700' } }
102+
let(:params) { { package_apt_pin: '700' } }
103103

104104
if Puppet.version =~ %r{^[6,7]} # https://tickets.puppetlabs.com/browse/PUP-9112 and https://tickets.puppetlabs.com/browse/PUP-9180
105105
let(:expected_key_apt_source_key_content) { 'nil' }
@@ -239,7 +239,7 @@
239239
is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin')
240240
end
241241

242-
it { is_expected.to contain_package('python') } if %w[RedHat Debian SUSE Archlinux].include?(facts[:os]['family'])
242+
it { is_expected.to contain_package('python') } if %w[Debian SUSE Archlinux].include?(facts[:os]['family'])
243243
it { is_expected.to contain_package('python2') } if %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
244244
end
245245

@@ -250,10 +250,11 @@
250250
is_expected.to contain_class('rabbitmq::install::rabbitmqadmin')
251251
is_expected.not_to contain_package('python')
252252
is_expected.not_to contain_package('python2')
253+
is_expected.not_to contain_package('python3')
253254
end
254255
end
255256

256-
context 'with $management_ip_address undef and service_manage set to true', unless: facts[:osfamily] == 'Archlinux' do
257+
context 'with $management_ip_address undef and service_manage set to true', unless: facts[:os]['family'] == 'Archlinux' do
257258
let(:params) { { admin_enable: true, management_ip_address: :undef } }
258259

259260
it 'we enable the admin interface by default' do
@@ -265,7 +266,7 @@
265266
end
266267
end
267268

268-
context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do
269+
context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified', unless: facts[:os]['family'] == 'Archlinux' do
269270
let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', node_ip_address: :undef } }
270271

271272
it 'we use the correct URL to rabbitmqadmin' do
@@ -277,7 +278,7 @@
277278
end
278279
end
279280

280-
context 'with service_manage set to true and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do
281+
context 'with service_manage set to true and default user/pass specified', unless: facts[:os]['family'] == 'Archlinux' do
281282
let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', management_ip_address: '1.1.1.1' } }
282283

283284
it 'we use the correct URL to rabbitmqadmin' do

0 commit comments

Comments
 (0)