13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ 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.1.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.0) (2023-10-30)

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

**Implemented enhancements:**

- Add additional applyto options for policies [\#948](https://github.com/voxpupuli/puppet-rabbitmq/pull/948) ([wyardley](https://github.com/wyardley))
- Add Puppet 8 support [\#938](https://github.com/voxpupuli/puppet-rabbitmq/pull/938) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- fix purge rabbitmq\_parameter [\#945](https://github.com/voxpupuli/puppet-rabbitmq/pull/945) ([fatpat](https://github.com/fatpat))

## [v13.0.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.0.0) (2023-05-13)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v12.1.0...v13.0.0)
Expand Down
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ The following properties are available in the `rabbitmq_policy` type.

##### `applyto`

Valid values: `all`, `exchanges`, `queues`
Valid values: `all`, `classic_queues`, `exchanges`, `queues`, `quorum_queues`, `streams`

policy apply to

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_parameter/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def set_parameter
key = resource[:name].rpartition('@').first

if @property_flush[:ensure] == :absent
rabbitmqctl('clear_parameter', '-p', vhost, resource[:component_name], key)
rabbitmqctl('clear_parameter', '-p', vhost, resource[:component_name] || component_name, key)
else
rabbitmqctl('set_parameter', '-p', vhost, resource[:component_name], key, resource[:value].to_json)
end
Expand Down
3 changes: 3 additions & 0 deletions lib/puppet/type/rabbitmq_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@
newproperty(:applyto) do
desc 'policy apply to'
newvalue(:all)
newvalue(:classic_queues)
newvalue(:exchanges)
newvalue(:queues)
newvalue(:quorum_queues)
newvalue(:streams)
defaultto :all
end

Expand Down
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": "13.0.0",
"version": "13.1.0",
"author": "voxpupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down Expand Up @@ -52,7 +52,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 7.0.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 9.0.0"
}
],
"dependencies": [
Expand Down
19 changes: 19 additions & 0 deletions spec/acceptance/parameter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,23 @@ class { 'rabbitmq':
end
end
end

context 'destroy parameter resource' do
it 'runs successfully' do
pp = <<-EOS
rabbitmq_parameter { 'documentumFed@fedhost':
ensure => absent,
}
EOS

apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

it 'does not have the parameter' do
shell('rabbitmqctl list_parameters -q') do |r|
expect(r.stdout).not_to match(%r{documentumFed\s+})
end
end
end
end
2 changes: 1 addition & 1 deletion spec/unit/puppet/type/rabbitmq_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
end

it 'accepts valid value for applyto' do
%i[all exchanges queues].each do |v|
%i[all classic_queues exchanges queues quorum_queues streams].each do |v|
policy[:applyto] = v
expect(policy[:applyto]).to eq(v)
end
Expand Down