Skip to content

Commit

Permalink
Merge pull request voxpupuli#983 from bastelfreak/epel
Browse files Browse the repository at this point in the history
CentOS7: default to EPEL7 as source
  • Loading branch information
bastelfreak authored May 19, 2024
2 parents a6cc7f9 + 450d168 commit 81e5057
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
fixtures:
repositories:
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
apt: 'https://github.com/puppetlabs/puppetlabs-apt'
archive: 'https://github.com/voxpupuli/puppet-archive'
erlang: 'https://github.com/garethr/garethr-erlang'
epel: 'https://github.com/voxpupuli/puppet-epel'
systemd: 'https://github.com/voxpupuli/puppet-systemd'
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ These are now documented via [Puppet Strings](https://github.com/puppetlabs/pupp

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

**[puppet/epel](https://forge.puppet.com/modules/puppet/epel) is a soft dependency. The module requires it if you're on CentOS 7**

Version v13.2.0 and older also added an erlang repository on CentOS 7. That isn't used and can be safely removed.

## Reference

See [REFERENCE](REFERENCE.md).
Expand Down
4 changes: 4 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@
}
}

# when repos_ensure is true, we configure externel repos
# CentOS 7 doesn't contain rabbitmq. It's only in EPEL.
if $repos_ensure {
case $facts['os']['family'] {
'RedHat': {
Expand All @@ -505,6 +507,8 @@
default: {
}
}
} elsif ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7') {
require epel
}

contain rabbitmq::install
Expand Down
20 changes: 2 additions & 18 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
context 'default class inclusion' do
let(:pp) do
<<-EOS
class { 'rabbitmq': }
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
include rabbitmq
EOS
end

Expand Down Expand Up @@ -54,10 +50,6 @@ class { 'erlang': epel_enable => true}
class { 'rabbitmq':
service_ensure => 'stopped',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
end

Expand All @@ -72,22 +64,14 @@ class { 'erlang': epel_enable => true}
context 'service is unmanaged' do
it 'runs successfully' do
pp_pre = <<-EOS
class { 'rabbitmq': }
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
include rabbitmq
EOS

pp = <<-EOS
class { 'rabbitmq':
service_manage => false,
service_ensure => 'stopped',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp_pre, catch_failures: true)
Expand Down
12 changes: 0 additions & 12 deletions spec/acceptance/clustering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ class { 'rabbitmq':
erlang_cookie => 'TESTCOOKIE',
wipe_db_on_cookie_change => false,
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp, expect_failures: true)
Expand All @@ -39,10 +35,6 @@ class { 'rabbitmq':
erlang_cookie => 'TESTCOOKIE',
wipe_db_on_cookie_change => true,
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp, catch_failures: true)
Expand Down Expand Up @@ -84,10 +76,6 @@ class { 'rabbitmq':
environment_variables => { 'NODENAME' => 'rabbit@foobar' },
erlang_cookie => 'TESTCOOKIE',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp, expect_failures: true)
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/delete_guest_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class { 'rabbitmq':
port => 5672,
delete_guest_user => true,
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp, catch_failures: true)
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
context 'create parameter resource' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
context 'create policy resource' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
12 changes: 0 additions & 12 deletions spec/acceptance/queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
context 'create binding and queue resources when using default management port' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down Expand Up @@ -80,10 +76,6 @@ class { 'rabbitmq':
context 'create multiple bindings when same source / destination / vhost but different routing keys' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down Expand Up @@ -168,10 +160,6 @@ class { 'rabbitmq':
context 'create binding and queue resources when using a non-default management port' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
16 changes: 0 additions & 16 deletions spec/acceptance/rabbitmqadmin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ class { 'rabbitmq':
admin_enable => true,
service_manage => true,
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

apply_manifest(pp, catch_failures: true)
Expand All @@ -31,10 +27,6 @@ class { 'rabbitmq':
admin_enable => true,
service_manage => false,
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
Expand All @@ -55,10 +47,6 @@ class { 'rabbitmq':
default_user => 'foobar',
default_pass => 'bazblam',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

pp = <<-EOS
Expand All @@ -68,10 +56,6 @@ class { 'rabbitmq':
default_user => 'foobar',
default_pass => 'bazblam',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

shell('rm -f /var/lib/rabbitmq/rabbitmqadmin')
Expand Down
4 changes: 0 additions & 4 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
context 'create user resource' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
8 changes: 2 additions & 6 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@
context 'create vhost resource' do
it 'runs successfully' do
pp = <<-EOS
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
}
class { 'rabbitmq':
service_manage => true,
port => 5672,
delete_guest_user => true,
admin_enable => true,
} ->
}
rabbitmq_vhost { 'myhost':
-> rabbitmq_vhost { 'myhost':
ensure => present,
}
EOS
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
when 'Debian'
install_puppet_module_via_pmt_on(host, 'puppetlabs-apt', '>= 4.1.0 < 9.0.0')
when 'RedHat'
install_puppet_module_via_pmt_on(host, 'garethr-erlang', '>= 0.3.0 < 1.0.0')
install_puppet_module_via_pmt_on(host, 'puppet-epel', '>= 5.0.0 < 6.0.0')
if fact_on(host, 'os.selinux.enabled')
# Make sure selinux is disabled so the tests work.
on host, puppet('resource', 'exec', 'setenforce 0', 'path=/bin:/sbin:/usr/bin:/usr/sbin', 'onlyif=which setenforce && getenforce | grep Enforcing')
Expand Down

0 comments on commit 81e5057

Please sign in to comment.