2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.12.0'
modulesync_config_version: '3.0.0'
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ RSpec/RepeatedDescription:
RSpec/NestedGroups:
Enabled: False

RSpec/MultipleExpectations:
Enabled: false

# this is broken on ruby1.9
Layout/IndentHeredoc:
Enabled: False
Expand Down
17 changes: 15 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,20 @@ 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.

## [v10.1.1](https://github.com/voxpupuli/puppet-rabbitmq/tree/v10.1.1) (2020-07-13)
## [v10.1.2](https://github.com/voxpupuli/puppet-rabbitmq/tree/v10.1.2) (2020-10-01)

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

**Fixed bugs:**

- Not idempotent again on RHEL based platforms since move to systemd module [\#836](https://github.com/voxpupuli/puppet-rabbitmq/issues/836)
- remove invalid cluster\_node\_type 'disk' [\#859](https://github.com/voxpupuli/puppet-rabbitmq/pull/859) ([danoe](https://github.com/danoe))

**Merged pull requests:**

- Ignore SELinux defaults for systemd on RHEL based [\#856](https://github.com/voxpupuli/puppet-rabbitmq/pull/856) ([tobias-urdin](https://github.com/tobias-urdin))

## [v10.1.1](https://github.com/voxpupuli/puppet-rabbitmq/tree/v10.1.1) (2020-07-15)

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

Expand Down Expand Up @@ -482,7 +495,7 @@ These should not affect the functionality of the module.
- Scope config\_variables for Puppet 4 [\#541](https://github.com/voxpupuli/puppet-rabbitmq/pull/541) ([jarro2783](https://github.com/jarro2783))
- \[msync\] 786266 Implement puppet-module-gems, a45803 Remove metadata.json from locales config [\#540](https://github.com/voxpupuli/puppet-rabbitmq/pull/540) ([wilson208](https://github.com/wilson208))
- \[MODULES-4528\] Replace Puppet.version.to\_f version comparison from spec\_helper.rb [\#538](https://github.com/voxpupuli/puppet-rabbitmq/pull/538) ([wilson208](https://github.com/wilson208))
- Systemd open files limit [\#535](https://github.com/voxpupuli/puppet-rabbitmq/pull/535) ([arteal](https://github.com/arteal))
- Systemd open files limit [\#535](https://github.com/voxpupuli/puppet-rabbitmq/pull/535) ([tomashejatko](https://github.com/tomashejatko))
- \[MODULES-4450\] don't set ssl depth if undef [\#534](https://github.com/voxpupuli/puppet-rabbitmq/pull/534) ([JAORMX](https://github.com/JAORMX))
- moved username:password to separate parameter [\#532](https://github.com/voxpupuli/puppet-rabbitmq/pull/532) ([vdmkenny](https://github.com/vdmkenny))
- \(maint\) parallel\_spec maintenance: spec\_helper [\#531](https://github.com/voxpupuli/puppet-rabbitmq/pull/531) ([eputnam](https://github.com/eputnam))
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'voxpupuli-test', '>= 1.4.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'voxpupuli-test', '~> 2.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
end

group :development do
Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ Default value: `undef`

##### `cluster_node_type`

Data type: `Enum['ram', 'disk', 'disc']`
Data type: `Enum['ram', 'disc']`

Choose between disc and ram nodes.

Expand Down
2 changes: 1 addition & 1 deletion examples/erlang_deps.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# install first the garethr-erlang module. See README.md
include erlang

class { 'erlang': epel_enable => true}
class { 'erlang': epel_enable => true }
Class['erlang'] -> Class['rabbitmq']
2 changes: 1 addition & 1 deletion examples/plugin.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$rabbitmq_plugins = [ 'amqp_client', 'rabbitmq_stomp' ]
$rabbitmq_plugins = ['amqp_client', 'rabbitmq_stomp']

class { 'rabbitmq':
config_stomp => true,
Expand Down
4 changes: 1 addition & 3 deletions examples/site.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node default {

$rabbitmq_plugins = [ 'amqp_client', 'rabbitmq_stomp' ]
$rabbitmq_plugins = ['amqp_client', 'rabbitmq_stomp']

class { 'rabbitmq':
config => '[ {rabbit_stomp, [{tcp_listeners, [1234]} ]} ].',
Expand All @@ -13,4 +12,3 @@
provider => 'rabbitmqplugins',
}
}

14 changes: 7 additions & 7 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#
# @api private
class rabbitmq::config {

$admin_enable = $rabbitmq::admin_enable
$management_enable = $rabbitmq::management_enable
$use_config_file_for_plugins = $rabbitmq::use_config_file_for_plugins
Expand Down Expand Up @@ -104,7 +103,7 @@
$management_ip_address = $rabbitmq::node_ip_address
}

$inetrc_env = {'export ERL_INETRC' => $inetrc_config_path}
$inetrc_env = { 'export ERL_INETRC' => $inetrc_config_path }

# Handle env variables.
$_environment_variables = $default_ssl_env_variables + $inetrc_env + $rabbitmq::environment_variables
Expand All @@ -125,7 +124,7 @@
$proto_dist = 'inet6_tcp'
$ssl_path = ''
}
$ipv6_or_tls_env = ['SERVER_ADDITIONAL', 'CTL'].reduce({}) |$memo, $item| {
$ipv6_or_tls_env = ['SERVER_ADDITIONAL', 'CTL'].reduce( {}) |$memo, $item| {
$orig = $_environment_variables["RABBITMQ_${item}_ERL_ARGS"]
$munged = $orig ? {
# already quoted, keep quoting
Expand All @@ -136,7 +135,7 @@
default => "\"${orig}${ssl_path} -proto_dist ${proto_dist}\"",
}
merge($memo, {"RABBITMQ_${item}_ERL_ARGS" => $munged})
merge($memo, { "RABBITMQ_${item}_ERL_ARGS" => $munged })
}
$environment_variables = $_environment_variables + $ipv6_or_tls_env
Expand Down Expand Up @@ -227,14 +226,15 @@
mode => '0644',
}
}
default: { }
default: {}
}
if $facts['systemd'] { # systemd fact provided by systemd module
systemd::service_limits { "${service_name}.service":
limits => {'LimitNOFILE' => $file_limit},
selinux_ignore_defaults => ($facts['os']['family'] == 'RedHat'),
limits => { 'LimitNOFILE' => $file_limit },
# The service will be notified when config changes
restart_service => false,
restart_service => false,
}
}
Expand Down
8 changes: 3 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,11 @@
# @param loopback_users
# This option configures a list of users to allow access via the loopback interfaces
#
class rabbitmq(
class rabbitmq (
Boolean $admin_enable = true,
Boolean $management_enable = false,
Boolean $use_config_file_for_plugins = false,
Enum['ram', 'disk', 'disc'] $cluster_node_type = 'disc',
Enum['ram', 'disc'] $cluster_node_type = 'disc',
Array $cluster_nodes = [],
String $config = 'rabbitmq/rabbitmq.config.erb',
Boolean $config_cluster = false,
Expand Down Expand Up @@ -399,12 +399,11 @@
Array $loopback_users = ['guest'],
Boolean $service_restart = true,
) {

if $ssl_only and ! $ssl {
fail('$ssl_only => true requires that $ssl => true')
}

if $config_stomp and $stomp_ssl_only and ! $ssl_stomp_port {
if $config_stomp and $stomp_ssl_only and ! $ssl_stomp_port {
fail('$stomp_ssl_only requires that $ssl_stomp_port be set')
}

Expand Down Expand Up @@ -498,5 +497,4 @@

# Make sure the various providers have their requirements in place.
Class['rabbitmq::install'] -> Rabbitmq_plugin<| |>

}
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# @api private
class rabbitmq::install {

$package_ensure = $rabbitmq::package_ensure
$package_name = $rabbitmq::package_name
$rabbitmq_group = $rabbitmq::rabbitmq_group
Expand Down
4 changes: 1 addition & 3 deletions manifests/install/rabbitmqadmin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
#
# @api private
class rabbitmq::install::rabbitmqadmin {

if $rabbitmq::rabbitmqadmin_package {
package{'rabbitmqadmin':
package { 'rabbitmqadmin':
ensure => 'present',
name => $rabbitmq::rabbitmqadmin_package,
}
} else {

$python_package = $rabbitmq::python_package
# Some systems (e.g., Ubuntu 16.04) don't ship Python 2 by default
if $rabbitmq::manage_python {
Expand Down
4 changes: 1 addition & 3 deletions manifests/management.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
#
# @api private
class rabbitmq::management {

$delete_guest_user = $rabbitmq::delete_guest_user

if $delete_guest_user {
rabbitmq_user{ 'guest':
rabbitmq_user { 'guest':
ensure => absent,
provider => 'rabbitmqctl',
}
}

}
5 changes: 2 additions & 3 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
# puppetlabs-stdlib
#
# @api private
class rabbitmq::repo::apt(
class rabbitmq::repo::apt (
String $location = 'https://packagecloud.io/rabbitmq/rabbitmq-server',
String $repos = 'main',
Boolean $include_src = false,
String $key = '8C695B0219AFDEB04A058ED8F4E789204D206F89',
String $key_source = $rabbitmq::package_gpg_key,
Optional[String] $key_content = $rabbitmq::key_content,
Optional[String] $architecture = undef,
) {

) {
$osname = downcase($facts['os']['name'])
$pin = $rabbitmq::package_apt_pin

Expand Down
9 changes: 4 additions & 5 deletions manifests/repo/rhel.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Makes sure that the Packagecloud repo is installed
#
# @api private
class rabbitmq::repo::rhel(
$location = "https://packagecloud.io/rabbitmq/rabbitmq-server/el/${facts['os'][release][major]}/\$basearch",
String $key_source = $rabbitmq::package_gpg_key,
) {

class rabbitmq::repo::rhel (
$location = "https://packagecloud.io/rabbitmq/rabbitmq-server/el/${facts['os'][release][major]}/\$basearch",
String $key_source = $rabbitmq::package_gpg_key,
) {
yumrepo { 'rabbitmq':
ensure => present,
name => 'rabbitmq_rabbitmq-server',
Expand Down
4 changes: 1 addition & 3 deletions manifests/service.pp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This class manages the rabbitmq server service itself.
#
# @api private
class rabbitmq::service(
class rabbitmq::service (
Enum['running', 'stopped'] $service_ensure = $rabbitmq::service_ensure,
Boolean $service_manage = $rabbitmq::service_manage,
$service_name = $rabbitmq::service_name,
) inherits rabbitmq {

if ($service_manage) {
if $service_ensure == 'running' {
$ensure_real = 'running'
Expand All @@ -28,5 +27,4 @@
Class['systemd::systemctl::daemon_reload'] -> Service['rabbitmq-server']
}
}

}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "10.1.1",
"version": "10.1.2",
"author": "voxpupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -69,7 +69,7 @@
},
{
"name": "camptocamp/systemd",
"version_requirement": ">= 2.1.0 < 3.0.0"
"version_requirement": ">= 2.10.0 < 3.0.0"
}
],
"tags": [
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the parameter' do
shell('rabbitmqctl list_parameters -p fedhost') do |r|
expect(r.stdout).to match(%r{federation-upstream.*documentumFed.*expires.*3600000})
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
expect(apply_manifest(pp, catch_changes: true).exit_code).to be_zero
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the policy' do
shell('rabbitmqctl list_policies -p myhost') do |r|
expect(r.stdout).to match(%r{myhost.*ha-all.*ha-sync-mode})
Expand Down
6 changes: 0 additions & 6 deletions spec/acceptance/queue_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the binding' do
shell('rabbitmqctl list_bindings -q -p host1') do |r|
expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\s#})
Expand Down Expand Up @@ -149,8 +147,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the bindings' do
shell('rabbitmqctl list_bindings -q -p host1') do |r|
expect(r.stdout).to match(%r{exchange1\sexchange\squeue1\squeue\stest1})
Expand Down Expand Up @@ -226,8 +222,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the binding' do
shell('rabbitmqctl list_bindings -q -p host2') do |r|
expect(r.stdout).to match(%r{exchange2\sexchange\squeue2\squeue\s#})
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the user' do
shell('rabbitmqctl list_users -q') do |r|
expect(r.stdout).to match(%r{dan.*administrator})
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class { 'rabbitmq':
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

# rubocop:disable RSpec/MultipleExpectations
it 'has the vhost' do
shell('rabbitmqctl list_vhosts') do |r|
expect(r.stdout).to match(%r{myhost})
Expand Down
3 changes: 3 additions & 0 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,11 @@
end

if facts[:systemd]
selinux_ignore_defaults = facts[:os]['family'] == 'RedHat'

it do
is_expected.to contain_systemd__service_limits("#{name}.service").
with_selinux_ignore_defaults(selinux_ignore_defaults).
with_limits('LimitNOFILE' => value).
with_restart_service(false)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
end
let(:provider) { provider_class.new(resource) }

# rubocop:disable RSpec/MultipleExpectations
describe '#instances' do
it 'returns instances' do
provider_class.expects(:rabbitmqctl_list).with('vhosts').returns <<-EOT
Expand Down Expand Up @@ -42,8 +41,6 @@
])
end
# rubocop:enable RSpec/MultipleExpectations

# rubocop:disable RSpec/MultipleExpectations
it 'returns multiple instances' do
provider_class.expects(:rabbitmqctl_list).with('vhosts').returns <<-EOT
/
Expand Down
Loading