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'
27 changes: 24 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v13.4.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.4.0) (2024-05-19)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.3.0...v13.4.0)

Historically we used the garethr/erlang module as soft dependency on CentOS 7. This also configured the EPEL7 repository. We have replaced this with an include of the EPEL repo on CentOS 7.

**Implemented enhancements:**

- puppetlabs/apt: Allow 9.x [\#988](https://github.com/voxpupuli/puppet-rabbitmq/pull/988) ([bastelfreak](https://github.com/bastelfreak))
- puppetlabs/stdlib: Allow 9.x [\#986](https://github.com/voxpupuli/puppet-rabbitmq/pull/986) ([bastelfreak](https://github.com/bastelfreak))
- puppet/archive: Allow 7.x [\#952](https://github.com/voxpupuli/puppet-rabbitmq/pull/952) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- metadata.json: re-add Puppet 8 support [\#985](https://github.com/voxpupuli/puppet-rabbitmq/pull/985) ([bastelfreak](https://github.com/bastelfreak))
- CentOS7: default to EPEL7 as source [\#983](https://github.com/voxpupuli/puppet-rabbitmq/pull/983) ([bastelfreak](https://github.com/bastelfreak))

**Merged pull requests:**

- docs: update readme badges [\#987](https://github.com/voxpupuli/puppet-rabbitmq/pull/987) ([wyardley](https://github.com/wyardley))

## [v13.3.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.3.0) (2024-05-19)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.2.0...v13.3.0)
Expand All @@ -25,7 +46,7 @@ These should not affect the functionality of the module.
- Migrate erb to epp templates [\#978](https://github.com/voxpupuli/puppet-rabbitmq/pull/978) ([nosrio](https://github.com/nosrio))
- Use a more expressive method of rewriting values [\#975](https://github.com/voxpupuli/puppet-rabbitmq/pull/975) ([ekohl](https://github.com/ekohl))

## [v13.2.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.2.0) (2023-12-10)
## [v13.2.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.2.0) (2023-12-11)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.1.2...v13.2.0)

Expand All @@ -37,7 +58,7 @@ These should not affect the functionality of the module.

- resources fail to prefetch when rabbitmq is not intended to be installed \(via --noop or --tags\) [\#961](https://github.com/voxpupuli/puppet-rabbitmq/issues/961)

## [v13.1.2](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.2) (2023-11-05)
## [v13.1.2](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.2) (2023-11-06)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.1.1...v13.1.2)

Expand Down Expand Up @@ -335,7 +356,7 @@ Debian 8 is EOL since some months now. Release 10.2.0 will be the last one with
**Merged pull requests:**

- docs: Updates autocluster plugin link [\#809](https://github.com/voxpupuli/puppet-rabbitmq/pull/809) ([wyardley](https://github.com/wyardley))
- Update link to rabbitmq-autocluster [\#808](https://github.com/voxpupuli/puppet-rabbitmq/pull/808) ([makmarius](https://github.com/makmarius))
- Update link to rabbitmq-autocluster [\#808](https://github.com/voxpupuli/puppet-rabbitmq/pull/808) ([ghost](https://github.com/ghost))
- Allow `puppetlabs/stdlib` 6.x and `puppet/archive` 4.x [\#803](https://github.com/voxpupuli/puppet-rabbitmq/pull/803) ([alexjfisher](https://github.com/alexjfisher))
- Remove unused curl\_prefix variable [\#800](https://github.com/voxpupuli/puppet-rabbitmq/pull/800) ([mbaldessari](https://github.com/mbaldessari))
- Use data-in-modules instead of params.pp [\#797](https://github.com/voxpupuli/puppet-rabbitmq/pull/797) ([dhoppe](https://github.com/dhoppe))
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# rabbitmq

[![License](https://img.shields.io/github/license/voxpupuli/puppet-rabbitmq.svg)](https://github.com/voxpupuli/puppet-rabbitmq/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/voxpupuli/puppet-rabbitmq.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-rabbitmq)
[![Code Coverage](https://coveralls.io/repos/github/voxpupuli/puppet-rabbitmq/badge.svg?branch=master)](https://coveralls.io/github/voxpupuli/puppet-rabbitmq)
[![Build Status](https://github.com/voxpupuli/puppet-rabbitmq/actions/workflows/ci.yml/badge.svg)](https://github.com/voxpupuli/puppet-rabbitmq/actions)
[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/rabbitmq.svg)](https://forge.puppetlabs.com/puppet/rabbitmq)
[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/rabbitmq.svg)](https://forge.puppetlabs.com/puppet/rabbitmq)
[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/rabbitmq.svg)](https://forge.puppetlabs.com/puppet/rabbitmq)
Expand Down Expand Up @@ -50,6 +49,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
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_cluster/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def create
init_node = @resource[:init_node].to_s.gsub(%r{^.*@}, '')
local_node = @resource[:local_node].to_s.gsub(%r{^.*@}, '')

if local_node == init_node || [Facter.value(:hostname), Facter.value(:fqdn)].include?(init_node)
if local_node == init_node || [Facter.value(:networking)['hostname'], Facter.value(:networking)['fqdn']].include?(init_node)
return rabbitmqctl('set_cluster_name', @resource[:name]) unless cluster_name == resource[:name].to_s
else
rabbitmqctl('stop_app')
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
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "13.3.0",
"version": "13.4.0",
"author": "Vox Pupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -52,17 +52,17 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 7.0.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 9.0.0"
}
],
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 9.0.0"
"version_requirement": ">= 4.25.0 < 10.0.0"
},
{
"name": "puppet/archive",
"version_requirement": ">= 2.0.0 < 7.0.0"
"version_requirement": ">= 2.0.0 < 8.0.0"
},
{
"name": "puppet/systemd",
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
16 changes: 2 additions & 14 deletions spec/acceptance/clustering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
it 'runs successfully' do
pp = <<-EOS
class { 'rabbitmq':
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['fqdn'] },
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['networking']['fqdn'] },
config_cluster => true,
cluster_nodes => ['rabbit1', 'rabbit2'],
cluster_node_type => 'ram',
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 @@ -32,17 +28,13 @@ class { 'erlang': epel_enable => true}
it 'runs successfully' do
pp = <<-EOS
class { 'rabbitmq':
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['fqdn'] },
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['networking']['fqdn'] },
config_cluster => true,
cluster_nodes => ['rabbit1', 'rabbit2'],
cluster_node_type => 'ram',
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
4 changes: 2 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
configure_beaker do |host|
case fact_on(host, 'os.family')
when 'Debian'
install_puppet_module_via_pmt_on(host, 'puppetlabs-apt', '>= 4.1.0 < 9.0.0')
install_puppet_module_via_pmt_on(host, 'puppetlabs-apt', '>= 4.1.0 < 10.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
Loading