Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS7: default to EPEL7 as source #983

Merged
merged 1 commit into from
May 19, 2024
Merged
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
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
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a strong opinion on how we should call the epel module. We could also just add it to the acceptance tests or introduce another parameter for it.

}

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 { '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 @@
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 Expand Up @@ -127,7 +111,7 @@
end

describe port(25_672) do
xit 'Is on 55672 instead on older rmq versions' do

Check warning on line 114 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - CentOS 7

rabbitmq class: binding on all interfaces Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 114 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Debian 10

rabbitmq class: binding on all interfaces Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 114 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 18.04

rabbitmq class: binding on all interfaces Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit
is_expected.to be_listening.on('0.0.0.0').with('tcp')
end
end
Expand Down Expand Up @@ -162,7 +146,7 @@
# This listens on all interfaces regardless of these settings

describe port(25_672) do
xit 'Is on 55672 instead on older rmq versions' do

Check warning on line 149 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - CentOS 7

rabbitmq class: binding to localhost only Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 149 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Debian 10

rabbitmq class: binding to localhost only Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 149 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 18.04

rabbitmq class: binding to localhost only Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit
is_expected.to be_listening.on('0.0.0.0').with('tcp')
end
end
Expand Down Expand Up @@ -227,7 +211,7 @@
end

describe port(25_672) do
xit 'Is on 55672 instead on older rmq versions' do

Check warning on line 214 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - CentOS 7

rabbitmq class: different management_ip_address and node_ip_address Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 214 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Debian 10

rabbitmq class: different management_ip_address and node_ip_address Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit

Check warning on line 214 in spec/acceptance/class_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Ubuntu 18.04

rabbitmq class: different management_ip_address and node_ip_address Port "25672" Is on 55672 instead on older rmq versions Skipped: Temporarily skipped with xit
is_expected.to be_listening.on('0.0.0.0').with('tcp')
end
end
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