Skip to content

Commit 58680e9

Browse files
committed
add needed docs, tests, and fixes.
1 parent 6a5c3c1 commit 58680e9

File tree

4 files changed

+210
-11
lines changed

4 files changed

+210
-11
lines changed

REFERENCE.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,11 @@ The following parameters are available in the `rabbitmq` class:
254254
* [`package_name`](#-rabbitmq--package_name)
255255
* [`port`](#-rabbitmq--port)
256256
* [`python_package`](#-rabbitmq--python_package)
257+
* [`quorum_membership_reconciliation_enabled`](#-rabbitmq--quorum_membership_reconciliation_enabled)
258+
* [`quorum_membership_reconciliation_auto_remove`](#-rabbitmq--quorum_membership_reconciliation_auto_remove)
259+
* [`quorum_membership_reconciliation_interval`](#-rabbitmq--quorum_membership_reconciliation_interval)
260+
* [`quorum_membership_reconciliation_trigger_interval`](#-rabbitmq--quorum_membership_reconciliation_trigger_interval)
261+
* [`quorum_membership_reconciliation_target_group_size`](#-rabbitmq--quorum_membership_reconciliation_target_group_size)
257262
* [`repos_ensure`](#-rabbitmq--repos_ensure)
258263
* [`service_ensure`](#-rabbitmq--service_ensure)
259264
* [`service_manage`](#-rabbitmq--service_manage)
@@ -799,6 +804,57 @@ Name of the package required by rabbitmqadmin.
799804

800805
Default value: `'python'`
801806

807+
##### <a name="-rabbitmq--quorum_membership_reconciliation_enabled"></a>`quorum_membership_reconciliation_enabled`
808+
809+
Data type: `Optional[Boolean]`
810+
811+
Boolean - Enables or disables continuous membership reconciliation.
812+
This requires RabbitMQ 3.13 or higher. More information on this configuration
813+
can be found here: https://www.rabbitmq.com/docs/quorum-queues
814+
815+
Default value: `undef`
816+
817+
##### <a name="-rabbitmq--quorum_membership_reconciliation_auto_remove"></a>`quorum_membership_reconciliation_auto_remove`
818+
819+
Data type: `Optional[Boolean]`
820+
821+
Boolean - Enables or disables automatic removal of member nodes that are no longer part of the cluster,
822+
but still a member of the quorum queue. This requires RabbitMQ 3.13 or higher. More information on this configuration
823+
can be found here: https://www.rabbitmq.com/docs/quorum-queues
824+
825+
Default value: `undef`
826+
827+
##### <a name="-rabbitmq--quorum_membership_reconciliation_interval"></a>`quorum_membership_reconciliation_interval`
828+
829+
Data type: `Optional[Integer]`
830+
831+
Integer - The default evaluation interval in milliseconds. This requires RabbitMQ 3.13 or higher. More information on this configuration
832+
can be found here: https://www.rabbitmq.com/docs/quorum-queues
833+
834+
Default value: `undef`
835+
836+
##### <a name="-rabbitmq--quorum_membership_reconciliation_trigger_interval"></a>`quorum_membership_reconciliation_trigger_interval`
837+
838+
Data type: `Optional[Integer]`
839+
840+
Integer - The reconciliation delay in milliseconds, used when a trigger event occurs,
841+
for example, a node is added or removed from the cluster or an applicable policy changes.
842+
This delay will be applied only once, then the regular interval will be used again.
843+
This requires RabbitMQ 3.13 or higher. More information on this configuration
844+
can be found here: https://www.rabbitmq.com/docs/quorum-queues
845+
846+
Default value: `undef`
847+
848+
##### <a name="-rabbitmq--quorum_membership_reconciliation_target_group_size"></a>`quorum_membership_reconciliation_target_group_size`
849+
850+
Data type: `Optional[Integer]`
851+
852+
Integer - Controls the target group size for a quorum queue
853+
This requires RabbitMQ 3.13 or higher. More information on this configuration
854+
can be found here: https://www.rabbitmq.com/docs/quorum-queues
855+
856+
Default value: `undef`
857+
802858
##### <a name="-rabbitmq--repos_ensure"></a>`repos_ensure`
803859

804860
Data type: `Boolean`

manifests/init.pp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,18 +241,26 @@
241241
# @param python_package
242242
# Name of the package required by rabbitmqadmin.
243243
# @param quorum_membership_reconciliation_enabled
244-
# Boolean - Enables or disables continuous membership reconciliation. Defaults Omitted
244+
# Boolean - Enables or disables continuous membership reconciliation.
245+
# This requires RabbitMQ 3.13 or higher. More information on this configuration
246+
# can be found here: https://www.rabbitmq.com/docs/quorum-queues
245247
# @param quorum_membership_reconciliation_auto_remove
246248
# Boolean - Enables or disables automatic removal of member nodes that are no longer part of the cluster,
247-
# but still a member of the quorum queue. Defaults Omitted
249+
# but still a member of the quorum queue. This requires RabbitMQ 3.13 or higher. More information on this configuration
250+
# can be found here: https://www.rabbitmq.com/docs/quorum-queues
248251
# @param quorum_membership_reconciliation_interval
249-
# Integer - The default evaluation interval in milliseconds. Defaults Omitted
252+
# Integer - The default evaluation interval in milliseconds. This requires RabbitMQ 3.13 or higher. More information on this configuration
253+
# can be found here: https://www.rabbitmq.com/docs/quorum-queues
250254
# @param quorum_membership_reconciliation_trigger_interval
251255
# Integer - The reconciliation delay in milliseconds, used when a trigger event occurs,
252256
# for example, a node is added or removed from the cluster or an applicable policy changes.
253-
# This delay will be applied only once, then the regular interval will be used again. Default Omitted
257+
# This delay will be applied only once, then the regular interval will be used again.
258+
# This requires RabbitMQ 3.13 or higher. More information on this configuration
259+
# can be found here: https://www.rabbitmq.com/docs/quorum-queues
254260
# @param quorum_membership_reconciliation_target_group_size
255-
# Integer - Default Omitted
261+
# Integer - Controls the target group size for a quorum queue
262+
# This requires RabbitMQ 3.13 or higher. More information on this configuration
263+
# can be found here: https://www.rabbitmq.com/docs/quorum-queues
256264
# @param repos_ensure
257265
# Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
258266
# Defaults to false (use system packages). This does not ensure that soft dependencies are present.

spec/classes/rabbitmq_spec.rb

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,12 +1788,147 @@
17881788
describe 'rabbitmq-heartbeat options' do
17891789
let(:params) { { heartbeat: 60 } }
17901790

1791-
it 'sets heartbeat paramter in config file' do
1791+
it 'sets heartbeat parameter in config file' do
17921792
is_expected.to contain_file('rabbitmq.config'). \
17931793
with_content(%r{\{heartbeat, 60\}})
17941794
end
17951795
end
17961796

1797+
describe 'rabbitmq-quorum_membership_reconciliation_enabled undef options' do
1798+
let(:params) { { quorum_membership_reconciliation_enabled: :undef } }
1799+
1800+
it 'sets quorum_membership_reconciliation_enabled parameter undef in config file' do
1801+
is_expected.not_to contain_file('rabbitmq.config'). \
1802+
with_content(%r{\{quorum_membership_reconciliation_enabled, .*\}})
1803+
end
1804+
end
1805+
1806+
describe 'rabbitmq-quorum_membership_reconciliation_enabled false options' do
1807+
let(:params) { { quorum_membership_reconciliation_enabled: false } }
1808+
1809+
it 'sets quorum_membership_reconciliation_enabled parameter false in config file' do
1810+
is_expected.to contain_file('rabbitmq.config'). \
1811+
with_content(%r{\{quorum_membership_reconciliation_enabled, false\}})
1812+
end
1813+
end
1814+
1815+
describe 'rabbitmq-quorum_membership_reconciliation_enabled true options' do
1816+
let(:params) { { quorum_membership_reconciliation_enabled: true } }
1817+
1818+
it 'sets quorum_membership_reconciliation_enabled parameter true in config file' do
1819+
is_expected.to contain_file('rabbitmq.config'). \
1820+
with_content(%r{\{quorum_membership_reconciliation_enabled, true\}})
1821+
end
1822+
end
1823+
1824+
describe 'rabbitmq-quorum_membership_reconciliation_auto_remove undef options' do
1825+
let(:params) { { quorum_membership_reconciliation_auto_remove: :undef } }
1826+
1827+
it 'sets quorum_membership_reconciliation_auto_remove parameter undef in config file' do
1828+
is_expected.not_to contain_file('rabbitmq.config'). \
1829+
with_content(%r{\{quorum_membership_reconciliation_auto_remove, .*\}})
1830+
end
1831+
end
1832+
1833+
describe 'rabbitmq-quorum_membership_reconciliation_auto_remove false options' do
1834+
let(:params) { { quorum_membership_reconciliation_auto_remove: false } }
1835+
1836+
it 'sets quorum_membership_reconciliation_auto_remove parameter false in config file' do
1837+
is_expected.to contain_file('rabbitmq.config'). \
1838+
with_content(%r{\{quorum_membership_reconciliation_auto_remove, false\}})
1839+
end
1840+
end
1841+
1842+
describe 'rabbitmq-quorum_membership_reconciliation_auto_remove true options' do
1843+
let(:params) { { quorum_membership_reconciliation_auto_remove: true } }
1844+
1845+
it 'sets quorum_membership_reconciliation_auto_remove parameter true in config file' do
1846+
is_expected.to contain_file('rabbitmq.config'). \
1847+
with_content(%r{\{quorum_membership_reconciliation_auto_remove, true\}})
1848+
end
1849+
end
1850+
1851+
describe 'rabbitmq-quorum_membership_reconciliation_interval undef options' do
1852+
let(:params) { { quorum_membership_reconciliation_interval: :undef } }
1853+
1854+
it 'sets quorum_membership_reconciliation_interval parameter undef in config file' do
1855+
is_expected.not_to contain_file('rabbitmq.config'). \
1856+
with_content(%r{\{quorum_membership_reconciliation_interval, .*\}})
1857+
end
1858+
end
1859+
1860+
describe 'rabbitmq-quorum_membership_reconciliation_interval 36000 options' do
1861+
let(:params) { { quorum_membership_reconciliation_interval: 36_000 } }
1862+
1863+
it 'sets quorum_membership_reconciliation_interval parameter 36000 in config file' do
1864+
is_expected.to contain_file('rabbitmq.config'). \
1865+
with_content(%r{\{quorum_membership_reconciliation_interval, 36000\}})
1866+
end
1867+
end
1868+
1869+
describe 'rabbitmq-quorum_membership_reconciliation_interval 36000000000 options' do
1870+
let(:params) { { quorum_membership_reconciliation_interval: 36_000_000_000 } }
1871+
1872+
it 'sets quorum_membership_reconciliation_interval parameter 36000000000 in config file' do
1873+
is_expected.to contain_file('rabbitmq.config'). \
1874+
with_content(%r{\{quorum_membership_reconciliation_interval, 36000000000\}})
1875+
end
1876+
end
1877+
1878+
describe 'rabbitmq-quorum_membership_reconciliation_trigger_interval undef options' do
1879+
let(:params) { { quorum_membership_reconciliation_trigger_interval: :undef } }
1880+
1881+
it 'sets quorum_membership_reconciliation_trigger_interval parameter undef in config file' do
1882+
is_expected.not_to contain_file('rabbitmq.config'). \
1883+
with_content(%r{\{quorum_membership_reconciliation_trigger_interval, .*\}})
1884+
end
1885+
end
1886+
1887+
describe 'rabbitmq-quorum_membership_reconciliation_trigger_interval 3600 options' do
1888+
let(:params) { { quorum_membership_reconciliation_trigger_interval: 3600 } }
1889+
1890+
it 'sets quorum_membership_reconciliation_trigger_interval parameter 3600 in config file' do
1891+
is_expected.to contain_file('rabbitmq.config'). \
1892+
with_content(%r{\{quorum_membership_reconciliation_trigger_interval, 3600\}})
1893+
end
1894+
end
1895+
1896+
describe 'rabbitmq-quorum_membership_reconciliation_trigger_interval 36000000000 options' do
1897+
let(:params) { { quorum_membership_reconciliation_trigger_interval: 36_000_000_000 } }
1898+
1899+
it 'sets quorum_membership_reconciliation_trigger_interval parameter 36000000000 in config file' do
1900+
is_expected.to contain_file('rabbitmq.config'). \
1901+
with_content(%r{\{quorum_membership_reconciliation_trigger_interval, 36000000000\}})
1902+
end
1903+
end
1904+
1905+
describe 'rabbitmq-quorum_membership_reconciliation_target_group_size undef options' do
1906+
let(:params) { { quorum_membership_reconciliation_target_group_size: :undef } }
1907+
1908+
it 'sets quorum_membership_reconciliation_target_group_size parameter undef in config file' do
1909+
is_expected.not_to contain_file('rabbitmq.config'). \
1910+
with_content(%r{\{quorum_membership_reconciliation_target_group_size, .*\}})
1911+
end
1912+
end
1913+
1914+
describe 'rabbitmq-quorum_membership_reconciliation_target_group_size 2 options' do
1915+
let(:params) { { quorum_membership_reconciliation_target_group_size: 2 } }
1916+
1917+
it 'sets quorum_membership_reconciliation_target_group_size parameter 2 in config file' do
1918+
is_expected.to contain_file('rabbitmq.config'). \
1919+
with_content(%r{\{quorum_membership_reconciliation_target_group_size, 2\}})
1920+
end
1921+
end
1922+
1923+
describe 'rabbitmq-quorum_membership_reconciliation_target_group_size 4 options' do
1924+
let(:params) { { quorum_membership_reconciliation_target_group_size: 4 } }
1925+
1926+
it 'sets quorum_membership_reconciliation_target_group_size parameter 4 in config file' do
1927+
is_expected.to contain_file('rabbitmq.config'). \
1928+
with_content(%r{\{quorum_membership_reconciliation_target_group_size, 4\}})
1929+
end
1930+
end
1931+
17971932
context 'delete_guest_user' do
17981933
describe 'should do nothing by default' do
17991934
it { is_expected.not_to contain_rabbitmq_user('guest') }

templates/rabbitmq.config.epp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@
2626
<%- } -%>
2727
{cluster_partition_handling, <%= $rabbitmq::config::cluster_partition_handling %>},
2828
<% } -%>
29-
<% if $rabbitmq::config::quorum_membership_reconciliation_enabled {-%>
29+
<% unless $rabbitmq::config::quorum_membership_reconciliation_enabled =~ Undef {-%>
3030
{quorum_membership_reconciliation_enabled, <%= $rabbitmq::config::quorum_membership_reconciliation_enabled %>},
3131
<% } -%>
32-
<% if $rabbitmq::config::quorum_membership_reconciliation_auto_remove {-%>
32+
<% unless $rabbitmq::config::quorum_membership_reconciliation_auto_remove =~ Undef {-%>
3333
{quorum_membership_reconciliation_auto_remove, <%= $rabbitmq::config::quorum_membership_reconciliation_auto_remove %>},
3434
<% } -%>
35-
<% if $rabbitmq::config::quorum_membership_reconciliation_interval {-%>
35+
<% unless $rabbitmq::config::quorum_membership_reconciliation_interval =~ Undef {-%>
3636
{quorum_membership_reconciliation_interval, <%= $rabbitmq::config::quorum_membership_reconciliation_interval %>},
3737
<% } -%>
38-
<% if $rabbitmq::config::quorum_membership_reconciliation_trigger_interval {-%>
38+
<% unless $rabbitmq::config::quorum_membership_reconciliation_trigger_interval =~ Undef {-%>
3939
{quorum_membership_reconciliation_trigger_interval, <%= $rabbitmq::config::quorum_membership_reconciliation_trigger_interval %>},
4040
<% } -%>
41-
<% if $rabbitmq::config::quorum_membership_reconciliation_target_group_size {-%>
41+
<% unless $rabbitmq::config::quorum_membership_reconciliation_target_group_size =~ Undef {-%>
4242
{quorum_membership_reconciliation_target_group_size, <%= $rabbitmq::config::quorum_membership_reconciliation_target_group_size %>},
4343
<% } -%>
4444
{tcp_listen_options, [

0 commit comments

Comments
 (0)