Skip to content
Open
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
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,11 @@ Default value: `'python'`
Data type: `Boolean`

Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
Defaults to true. This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788

Default value: `false`
Default value: `true`

##### <a name="-rabbitmq--service_ensure"></a>`service_ensure`

Expand Down
1 change: 0 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ rabbitmq::repo_gpg_key: ~
rabbitmq::package_name: 'rabbitmq'
rabbitmq::package_source: ~
rabbitmq::package_provider: ~
rabbitmq::repos_ensure: false
rabbitmq::manage_python: true
rabbitmq::python_package: 'python'
rabbitmq::rabbitmq_user: 'rabbitmq'
Expand Down
3 changes: 2 additions & 1 deletion data/family/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
rabbitmq::python_package: 'python3'
rabbitmq::package_name: 'rabbitmq-server'
rabbitmq::service_name: 'rabbitmq-server'
rabbitmq::package_gpg_key: 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc'
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
1 change: 0 additions & 1 deletion examples/full.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class { 'rabbitmq':
delete_guest_user => true,
repos_ensure => true,
package_apt_pin => 900,
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
# Name of the package required by rabbitmqadmin.
# @param repos_ensure
# Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
# Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
# Defaults to true. This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
# It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
# different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788
# @param service_ensure
Expand Down Expand Up @@ -377,7 +377,7 @@
Variant[String, Array] $package_name = 'rabbitmq',
Optional[String] $package_source = undef,
Optional[String] $package_provider = undef,
Boolean $repos_ensure = false,
Boolean $repos_ensure = true,
Boolean $manage_python = true,
String $python_package = 'python',
String $rabbitmq_user = 'rabbitmq',
Expand Down
20 changes: 4 additions & 16 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
context 'default class inclusion' do
let(:pp) do
<<-EOS
class { 'erlang': } ->
class { 'rabbitmq': }
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS
end

Expand Down Expand Up @@ -51,13 +48,10 @@ class { 'erlang': epel_enable => true}
context 'disable and stop service' do
let(:pp) do
<<-EOS
class { 'erlang': } ->
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 +66,16 @@ class { 'erlang': epel_enable => true}
context 'service is unmanaged' do
it 'runs successfully' do
pp_pre = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq': }
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

pp = <<-EOS
class { 'erlang': } ->
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
15 changes: 3 additions & 12 deletions spec/acceptance/clustering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
context 'rabbitmq::wipe_db_on_cookie_change => false' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq':
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['fqdn'] },
config_cluster => true,
Expand All @@ -14,10 +15,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 @@ -31,6 +28,7 @@ class { 'erlang': epel_enable => true}
context 'rabbitmq::wipe_db_on_cookie_change => true' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq':
cluster => { 'name' => 'rabbit_cluster', 'init_node' => $facts['fqdn'] },
config_cluster => true,
Expand All @@ -39,10 +37,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 @@ -76,6 +70,7 @@ class { 'erlang': epel_enable => true}
context 'rabbitmq::cluster[:local_node] = foobar' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq':
cluster => { 'name' => 'rabbit_cluster', 'init_node' => 'foobar', 'local_node' => 'foobar' },
config_cluster => true,
Expand All @@ -84,10 +79,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
5 changes: 1 addition & 4 deletions spec/acceptance/delete_guest_user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
context 'delete_guest_user' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
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
5 changes: 1 addition & 4 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
5 changes: 1 addition & 4 deletions spec/acceptance/policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
15 changes: 3 additions & 12 deletions spec/acceptance/queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down Expand Up @@ -80,10 +77,7 @@ 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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down Expand Up @@ -168,10 +162,7 @@ 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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
20 changes: 4 additions & 16 deletions spec/acceptance/rabbitmqadmin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,11 @@
context 'downloads the cli tools' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
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 @@ -27,14 +24,11 @@ class { 'erlang': epel_enable => true}
context 'does nothing if service is unmanaged' do
it 'runs successfully' do
pp = <<-EOS
class { 'erlang': } ->
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 @@ -50,28 +44,22 @@ class { 'erlang': epel_enable => true}
it 'runs successfully' do
# make sure credential change takes effect before admin_enable
pp_pre = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
default_user => 'foobar',
default_pass => 'bazblam',
}
if $facts['os']['family'] == 'RedHat' {
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']
}
EOS

pp = <<-EOS
class { 'erlang': } ->
class { 'rabbitmq':
admin_enable => true,
service_manage => true,
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
5 changes: 1 addition & 4 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
5 changes: 1 addition & 4 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
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 { 'erlang': } ->
class { 'rabbitmq':
service_manage => true,
port => 5672,
Expand Down
Loading