Skip to content

Commit 450d168

Browse files
committed
CentOS7: default to EPEL7 as source
Historically we used the garethr/erlang module as soft dependency on CentOS 7. This also configured the EPEL7 repository. I always always a bit unsure where the actual rabbitmq packages come from. I assumed somehow from the erlang repo. My impression is that the erlan repo isn't used at all. rabbitmq packages where always pulled from EPEL7. The problem with the garethr/erlang is that it depends on the deprecated `stahnma/epel` (which is now puppet/epel) and uses topscope facts and variables. The module doesn't work anymore with Puppet 8. This PR replaces the unused garethr/erlang directly with the EPEL module.
1 parent be1d148 commit 450d168

File tree

13 files changed

+15
-82
lines changed

13 files changed

+15
-82
lines changed

.fixtures.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
---
12
fixtures:
23
repositories:
34
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
45
apt: 'https://github.com/puppetlabs/puppetlabs-apt'
56
archive: 'https://github.com/voxpupuli/puppet-archive'
6-
erlang: 'https://github.com/garethr/garethr-erlang'
7+
epel: 'https://github.com/voxpupuli/puppet-epel'
78
systemd: 'https://github.com/voxpupuli/puppet-systemd'
89
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ These are now documented via [Puppet Strings](https://github.com/puppetlabs/pupp
5050

5151
You can view example usage in [REFERENCE](REFERENCE.md).
5252

53+
**[puppet/epel](https://forge.puppet.com/modules/puppet/epel) is a soft dependency. The module requires it if you're on CentOS 7**
54+
55+
Version v13.2.0 and older also added an erlang repository on CentOS 7. That isn't used and can be safely removed.
56+
5357
## Reference
5458

5559
See [REFERENCE](REFERENCE.md).

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@
492492
}
493493
}
494494

495+
# when repos_ensure is true, we configure externel repos
496+
# CentOS 7 doesn't contain rabbitmq. It's only in EPEL.
495497
if $repos_ensure {
496498
case $facts['os']['family'] {
497499
'RedHat': {
@@ -505,6 +507,8 @@
505507
default: {
506508
}
507509
}
510+
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') {
511+
require epel
508512
}
509513

510514
contain rabbitmq::install

spec/acceptance/class_spec.rb

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
context 'default class inclusion' do
1616
let(:pp) do
1717
<<-EOS
18-
class { 'rabbitmq': }
19-
if $facts['os']['family'] == 'RedHat' {
20-
class { 'erlang': epel_enable => true}
21-
Class['erlang'] -> Class['rabbitmq']
22-
}
18+
include rabbitmq
2319
EOS
2420
end
2521

@@ -54,10 +50,6 @@ class { 'erlang': epel_enable => true}
5450
class { 'rabbitmq':
5551
service_ensure => 'stopped',
5652
}
57-
if $facts['os']['family'] == 'RedHat' {
58-
class { 'erlang': epel_enable => true}
59-
Class['erlang'] -> Class['rabbitmq']
60-
}
6153
EOS
6254
end
6355

@@ -72,22 +64,14 @@ class { 'erlang': epel_enable => true}
7264
context 'service is unmanaged' do
7365
it 'runs successfully' do
7466
pp_pre = <<-EOS
75-
class { 'rabbitmq': }
76-
if $facts['os']['family'] == 'RedHat' {
77-
class { 'erlang': epel_enable => true}
78-
Class['erlang'] -> Class['rabbitmq']
79-
}
67+
include rabbitmq
8068
EOS
8169

8270
pp = <<-EOS
8371
class { 'rabbitmq':
8472
service_manage => false,
8573
service_ensure => 'stopped',
8674
}
87-
if $facts['os']['family'] == 'RedHat' {
88-
class { 'erlang': epel_enable => true}
89-
Class['erlang'] -> Class['rabbitmq']
90-
}
9175
EOS
9276

9377
apply_manifest(pp_pre, catch_failures: true)

spec/acceptance/clustering_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ class { 'rabbitmq':
1414
erlang_cookie => 'TESTCOOKIE',
1515
wipe_db_on_cookie_change => false,
1616
}
17-
if $facts['os']['family'] == 'RedHat' {
18-
class { 'erlang': epel_enable => true}
19-
Class['erlang'] -> Class['rabbitmq']
20-
}
2117
EOS
2218

2319
apply_manifest(pp, expect_failures: true)
@@ -39,10 +35,6 @@ class { 'rabbitmq':
3935
erlang_cookie => 'TESTCOOKIE',
4036
wipe_db_on_cookie_change => true,
4137
}
42-
if $facts['os']['family'] == 'RedHat' {
43-
class { 'erlang': epel_enable => true}
44-
Class['erlang'] -> Class['rabbitmq']
45-
}
4638
EOS
4739

4840
apply_manifest(pp, catch_failures: true)
@@ -84,10 +76,6 @@ class { 'rabbitmq':
8476
environment_variables => { 'NODENAME' => 'rabbit@foobar' },
8577
erlang_cookie => 'TESTCOOKIE',
8678
}
87-
if $facts['os']['family'] == 'RedHat' {
88-
class { 'erlang': epel_enable => true}
89-
Class['erlang'] -> Class['rabbitmq']
90-
}
9179
EOS
9280

9381
apply_manifest(pp, expect_failures: true)

spec/acceptance/delete_guest_user_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ class { 'rabbitmq':
1010
port => 5672,
1111
delete_guest_user => true,
1212
}
13-
if $facts['os']['family'] == 'RedHat' {
14-
class { 'erlang': epel_enable => true}
15-
Class['erlang'] -> Class['rabbitmq']
16-
}
1713
EOS
1814

1915
apply_manifest(pp, catch_failures: true)

spec/acceptance/parameter_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
context 'create parameter resource' do
77
it 'runs successfully' do
88
pp = <<-EOS
9-
if $facts['os']['family'] == 'RedHat' {
10-
class { 'erlang': epel_enable => true }
11-
Class['erlang'] -> Class['rabbitmq']
12-
}
139
class { 'rabbitmq':
1410
service_manage => true,
1511
port => 5672,

spec/acceptance/policy_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
context 'create policy resource' do
77
it 'runs successfully' do
88
pp = <<-EOS
9-
if $facts['os']['family'] == 'RedHat' {
10-
class { 'erlang': epel_enable => true }
11-
Class['erlang'] -> Class['rabbitmq']
12-
}
139
class { 'rabbitmq':
1410
service_manage => true,
1511
port => 5672,

spec/acceptance/queue_spec.rb

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
context 'create binding and queue resources when using default management port' do
77
it 'runs successfully' do
88
pp = <<-EOS
9-
if $facts['os']['family'] == 'RedHat' {
10-
class { 'erlang': epel_enable => true }
11-
Class['erlang'] -> Class['rabbitmq']
12-
}
139
class { 'rabbitmq':
1410
service_manage => true,
1511
port => 5672,
@@ -80,10 +76,6 @@ class { 'rabbitmq':
8076
context 'create multiple bindings when same source / destination / vhost but different routing keys' do
8177
it 'runs successfully' do
8278
pp = <<-EOS
83-
if $facts['os']['family'] == 'RedHat' {
84-
class { 'erlang': epel_enable => true }
85-
Class['erlang'] -> Class['rabbitmq']
86-
}
8779
class { 'rabbitmq':
8880
service_manage => true,
8981
port => 5672,
@@ -168,10 +160,6 @@ class { 'rabbitmq':
168160
context 'create binding and queue resources when using a non-default management port' do
169161
it 'runs successfully' do
170162
pp = <<-EOS
171-
if $facts['os']['family'] == 'RedHat' {
172-
class { 'erlang': epel_enable => true }
173-
Class['erlang'] -> Class['rabbitmq']
174-
}
175163
class { 'rabbitmq':
176164
service_manage => true,
177165
port => 5672,

spec/acceptance/rabbitmqadmin_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ class { 'rabbitmq':
1010
admin_enable => true,
1111
service_manage => true,
1212
}
13-
if $facts['os']['family'] == 'RedHat' {
14-
class { 'erlang': epel_enable => true}
15-
Class['erlang'] -> Class['rabbitmq']
16-
}
1713
EOS
1814

1915
apply_manifest(pp, catch_failures: true)
@@ -31,10 +27,6 @@ class { 'rabbitmq':
3127
admin_enable => true,
3228
service_manage => false,
3329
}
34-
if $facts['os']['family'] == 'RedHat' {
35-
class { 'erlang': epel_enable => true}
36-
Class['erlang'] -> Class['rabbitmq']
37-
}
3830
EOS
3931

4032
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
@@ -55,10 +47,6 @@ class { 'rabbitmq':
5547
default_user => 'foobar',
5648
default_pass => 'bazblam',
5749
}
58-
if $facts['os']['family'] == 'RedHat' {
59-
class { 'erlang': epel_enable => true}
60-
Class['erlang'] -> Class['rabbitmq']
61-
}
6250
EOS
6351

6452
pp = <<-EOS
@@ -68,10 +56,6 @@ class { 'rabbitmq':
6856
default_user => 'foobar',
6957
default_pass => 'bazblam',
7058
}
71-
if $facts['os']['family'] == 'RedHat' {
72-
class { 'erlang': epel_enable => true}
73-
Class['erlang'] -> Class['rabbitmq']
74-
}
7559
EOS
7660

7761
shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')

0 commit comments

Comments
 (0)