File tree Expand file tree Collapse file tree 7 files changed +48
-0
lines changed Expand file tree Collapse file tree 7 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,7 @@ The following parameters are available in the `rabbitmq` class:
277277* [ ` package_name ` ] ( #-rabbitmq--package_name )
278278* [ ` port ` ] ( #-rabbitmq--port )
279279* [ ` python_package ` ] ( #-rabbitmq--python_package )
280+ * [ ` quorum_cluster_size ` ] ( #-rabbitmq--quorum_cluster_size )
280281* [ ` quorum_membership_reconciliation_enabled ` ] ( #-rabbitmq--quorum_membership_reconciliation_enabled )
281282* [ ` quorum_membership_reconciliation_auto_remove ` ] ( #-rabbitmq--quorum_membership_reconciliation_auto_remove )
282283* [ ` quorum_membership_reconciliation_interval ` ] ( #-rabbitmq--quorum_membership_reconciliation_interval )
@@ -845,6 +846,15 @@ Name of the package required by rabbitmqadmin.
845846
846847Default value: ` 'python' `
847848
849+ ##### <a name =" -rabbitmq--quorum_cluster_size " ></a >` quorum_cluster_size `
850+
851+ Data type: ` Optional[Integer] `
852+
853+ Sets the default quorum queue cluster size.
854+ More info can be found here: https://www.rabbitmq.com/docs/quorum-queues
855+
856+ Default value: ` undef `
857+
848858##### <a name =" -rabbitmq--quorum_membership_reconciliation_enabled " ></a >` quorum_membership_reconciliation_enabled `
849859
850860Data type: ` Optional[Boolean] `
Original file line number Diff line number Diff line change 1313 message-ttl
1414 queue-version
1515 shards-per-node
16+ target-group-size
1617] . freeze
1718
1819Puppet ::Type . newtype ( :rabbitmq_policy ) do
Original file line number Diff line number Diff line change 2828 $management_ssl = $rabbitmq::management_ssl
2929 $management_hostname = $rabbitmq::management_hostname
3030 $node_ip_address = $rabbitmq::node_ip_address
31+ $quorum_cluster_size = $rabbitmq::quorum_cluster_size
3132 $quorum_membership_reconciliation_enabled = $rabbitmq::quorum_membership_reconciliation_enabled
3233 $quorum_membership_reconciliation_auto_remove = $rabbitmq::quorum_membership_reconciliation_auto_remove
3334 $quorum_membership_reconciliation_interval = $rabbitmq::quorum_membership_reconciliation_interval
Original file line number Diff line number Diff line change 260260# The RabbitMQ port.
261261# @param python_package
262262# Name of the package required by rabbitmqadmin.
263+ # @param quorum_cluster_size
264+ # Sets the default quorum queue cluster size.
265+ # More info can be found here: https://www.rabbitmq.com/docs/quorum-queues
263266# @param quorum_membership_reconciliation_enabled
264267# Enables or disables continuous membership reconciliation.
265268# This REQUIRES RabbitMQ 3.13 or higher to be set to true. More information on this configuration
421424 Optional[Variant[Numeric, String[1]]] $package_apt_pin = undef ,
422425 String $package_ensure = ' installed' ,
423426 Optional[String] $package_gpg_key = undef ,
427+ Optional[Integer] $quorum_cluster_size = undef ,
424428 Optional[Boolean] $quorum_membership_reconciliation_enabled = undef ,
425429 Optional[Boolean] $quorum_membership_reconciliation_auto_remove = undef ,
426430 Optional[Integer] $quorum_membership_reconciliation_interval = undef ,
Original file line number Diff line number Diff line change 18171817 end
18181818 end
18191819
1820+ describe 'quorum_cluster_size with default value' do
1821+ it 'does not set quorum_cluster_size' do
1822+ is_expected . to contain_file ( 'rabbitmq.config' ) . \
1823+ without_content ( %r{quorum_cluster_size, } )
1824+ end
1825+ end
1826+
1827+ describe 'quorum_cluster_size with non-default value' do
1828+ let ( :params ) { { quorum_cluster_size : 7 } }
1829+
1830+ it 'does set quorum_cluster_size to 7' do
1831+ is_expected . to contain_file ( 'rabbitmq.config' ) . \
1832+ with_content ( %r{quorum_cluster_size, 7} )
1833+ end
1834+ end
1835+
18201836 # Ensure that whenever Param quorum_membership_reconciliation_enabled is unset - none of the
18211837 # other quorum_membership_reconciliation paramaters are set at all
18221838 # This ensures full backward compatibility with PRE RabbitMQ 3.13
Original file line number Diff line number Diff line change 234234 end . to raise_error ( Puppet ::Error , %r{Invalid queue-version value.*oogabooga} )
235235 end
236236
237+ it 'accepts and converts the target-group-size value' do
238+ definition = { 'target-group-size' => '7' }
239+ policy [ :definition ] = definition
240+ expect ( policy [ :definition ] [ 'target-group-size' ] ) . to eq ( 7 )
241+ end
242+
243+ it 'does not accept non-numeric target-group-size value' do
244+ definition = { 'target-group-size' => 'notreal' }
245+ expect do
246+ policy [ :definition ] = definition
247+ end . to raise_error ( Puppet ::Error , %r{Invalid target-group-size value.*notreal} )
248+ end
249+
237250 context 'accepts list value in ha-params when ha-mode = nodes' do
238251 before do
239252 policy [ :definition ] = definition
Original file line number Diff line number Diff line change 2626 <%- } -%>
2727 {cluster_partition_handling, <%= $rabbitmq::config::cluster_partition_handling %>},
2828<% } -%>
29+ <% if $rabbitmq::config::quorum_cluster_size {-%>
30+ {quorum_cluster_size, <%= $rabbitmq::config::quorum_cluster_size %>},
31+ <%- } -%>
2932<% if $rabbitmq::config::quorum_membership_reconciliation_enabled {-%>
3033 {quorum_membership_reconciliation_enabled, <%= $rabbitmq::config::quorum_membership_reconciliation_enabled %>},
3134 <%- unless $rabbitmq::config::quorum_membership_reconciliation_auto_remove =~ Undef {-%>
You can’t perform that action at this time.
0 commit comments