Showing with 27 additions and 2 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 lib/puppet/provider/rabbitmq_policy/rabbitmqctl.rb
  3. +1 −1 metadata.json
  4. +17 −0 spec/unit/puppet/provider/rabbitmq_policy/rabbitmqctl_spec.rb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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.2](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.2) (2023-11-05)

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

**Fixed bugs:**

- Bugfix: Fix parsing issue for queue policies targeted at quorum queues [\#958](https://github.com/voxpupuli/puppet-rabbitmq/pull/958) ([jimmybigcommerce](https://github.com/jimmybigcommerce))

## [v13.1.1](https://github.com/voxpupuli/puppet-rabbitmq/tree/v13.1.1) (2023-11-01)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v13.1.0...v13.1.1)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/rabbitmq_policy/rabbitmqctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.policies(vhost, name)
# / ha-all all .* {"ha-mode":"all","ha-sync-mode":"automatic"} 0 << This is for RabbitMQ v < 3.7.0
# / ha-all .* all {"ha-mode":"all","ha-sync-mode":"automatic"} 0 << This is for RabbitMQ v >= 3.7.0
if Puppet::Util::Package.versioncmp(rabbitmq_version, '3.7') >= 0
regex = %r{^(\S+)\s+(\S+)\s+(\S+)\s+(all|exchanges|queues)?\s+(\S+)\s+(\d+)$}
regex = %r{^(\S+)\s+(\S+)\s+(\S+)\s+(all|exchanges|(?:classic_|quorum_)?queues|streams)?\s+(\S+)\s+(\d+)$}
applyto_index = 4
pattern_index = 3
else
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "13.1.1",
"version": "13.1.2",
"author": "voxpupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down
17 changes: 17 additions & 0 deletions spec/unit/puppet/provider/rabbitmq_policy/rabbitmqctl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,23 @@
'ha-sync-mode' => 'automatic'
})
end

it 'matches policies from list targeting quorum queues' do
provider.class.expects(:rabbitmq_version).returns '3.7.0'
provider.class.expects(:rabbitmqctl_list).with('policies', '-p', '/').returns <<~EOT
/ ha-all ^.*$ quorum_queues {"delivery-limit":10,"initial-cluster-size":3,"max-length":100000000,"overflow":"reject-publish-dlx"} 0
/ test .* exchanges {"ha-mode":"all"} 0
EOT
expect(provider.exists?).to eq(applyto: 'quorum_queues',
pattern: '^.*$',
priority: '0',
definition: {
'delivery-limit' => 10,
'initial-cluster-size' => 3,
'max-length' => 100_000_000,
'overflow' => 'reject-publish-dlx'
})
end
end

context 'with RabbitMQ version >=3.2.0 and < 3.7.0' do
Expand Down