RabbitMQ: Add support for quorum queue options
Depends-on: https://review.opendev.org/894866 Change-Id: I096fb482c769f94538d1d09c4d0d729ea5aaf180
This commit is contained in:
parent
26a0220249
commit
62a49a7b3c
|
@ -109,6 +109,24 @@
|
|||
# will be run through a green thread.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*rabbit_quorum_queue*]
|
||||
# (Optional) Use quorum queues in RabbitMQ.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*rabbit_quorum_delivery_limit*]
|
||||
# (Optional) Each time a message is rdelivered to a consumer, a counter is
|
||||
# incremented. Once the redelivery count exceeds the delivery limit
|
||||
# the message gets dropped or dead-lettered.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*rabbit_quorum_max_memory_length*]
|
||||
# (Optional) Limit the number of messages in the quorum queue.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*rabbit_quorum_max_memory_bytes*]
|
||||
# (Optional) Limit the number of memory bytes used by the quorum queue.
|
||||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
# [*kombu_ssl_version*]
|
||||
# (optional) SSL version to use (valid only if SSL enabled).
|
||||
# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be
|
||||
|
@ -214,53 +232,57 @@
|
|||
# Defaults to $facts['os_service_default']
|
||||
#
|
||||
class sahara(
|
||||
$package_ensure = 'present',
|
||||
$host = $facts['os_service_default'],
|
||||
$port = $facts['os_service_default'],
|
||||
$plugins = $facts['os_service_default'],
|
||||
$use_floating_ips = $facts['os_service_default'],
|
||||
$node_domain = $facts['os_service_default'],
|
||||
$use_designate = $facts['os_service_default'],
|
||||
$nameservers = $facts['os_service_default'],
|
||||
Boolean $use_ssl = false,
|
||||
$ca_file = $facts['os_service_default'],
|
||||
$cert_file = $facts['os_service_default'],
|
||||
$key_file = $facts['os_service_default'],
|
||||
Boolean $sync_db = true,
|
||||
$default_transport_url = $facts['os_service_default'],
|
||||
$rpc_response_timeout = $facts['os_service_default'],
|
||||
$control_exchange = $facts['os_service_default'],
|
||||
$amqp_durable_queues = $facts['os_service_default'],
|
||||
$rabbit_ha_queues = $facts['os_service_default'],
|
||||
$rabbit_use_ssl = $facts['os_service_default'],
|
||||
$rabbit_login_method = $facts['os_service_default'],
|
||||
$rabbit_retry_interval = $facts['os_service_default'],
|
||||
$rabbit_retry_backoff = $facts['os_service_default'],
|
||||
$rabbit_heartbeat_in_pthread = $facts['os_service_default'],
|
||||
$kombu_ssl_version = $facts['os_service_default'],
|
||||
$kombu_ssl_keyfile = $facts['os_service_default'],
|
||||
$kombu_ssl_certfile = $facts['os_service_default'],
|
||||
$kombu_ssl_ca_certs = $facts['os_service_default'],
|
||||
$kombu_reconnect_delay = $facts['os_service_default'],
|
||||
$kombu_failover_strategy = $facts['os_service_default'],
|
||||
$kombu_compression = $facts['os_service_default'],
|
||||
$amqp_server_request_prefix = $facts['os_service_default'],
|
||||
$amqp_broadcast_prefix = $facts['os_service_default'],
|
||||
$amqp_group_request_prefix = $facts['os_service_default'],
|
||||
$amqp_container_name = $facts['os_service_default'],
|
||||
$amqp_idle_timeout = $facts['os_service_default'],
|
||||
$amqp_trace = $facts['os_service_default'],
|
||||
$amqp_ssl_ca_file = $facts['os_service_default'],
|
||||
$amqp_ssl_cert_file = $facts['os_service_default'],
|
||||
$amqp_ssl_key_file = $facts['os_service_default'],
|
||||
$amqp_ssl_key_password = $facts['os_service_default'],
|
||||
$amqp_sasl_mechanisms = $facts['os_service_default'],
|
||||
$amqp_sasl_config_dir = $facts['os_service_default'],
|
||||
$amqp_sasl_config_name = $facts['os_service_default'],
|
||||
$amqp_username = $facts['os_service_default'],
|
||||
$amqp_password = $facts['os_service_default'],
|
||||
Boolean $purge_config = false,
|
||||
$default_ntp_server = $facts['os_service_default'],
|
||||
$package_ensure = 'present',
|
||||
$host = $facts['os_service_default'],
|
||||
$port = $facts['os_service_default'],
|
||||
$plugins = $facts['os_service_default'],
|
||||
$use_floating_ips = $facts['os_service_default'],
|
||||
$node_domain = $facts['os_service_default'],
|
||||
$use_designate = $facts['os_service_default'],
|
||||
$nameservers = $facts['os_service_default'],
|
||||
Boolean $use_ssl = false,
|
||||
$ca_file = $facts['os_service_default'],
|
||||
$cert_file = $facts['os_service_default'],
|
||||
$key_file = $facts['os_service_default'],
|
||||
Boolean $sync_db = true,
|
||||
$default_transport_url = $facts['os_service_default'],
|
||||
$rpc_response_timeout = $facts['os_service_default'],
|
||||
$control_exchange = $facts['os_service_default'],
|
||||
$amqp_durable_queues = $facts['os_service_default'],
|
||||
$rabbit_ha_queues = $facts['os_service_default'],
|
||||
$rabbit_use_ssl = $facts['os_service_default'],
|
||||
$rabbit_login_method = $facts['os_service_default'],
|
||||
$rabbit_retry_interval = $facts['os_service_default'],
|
||||
$rabbit_retry_backoff = $facts['os_service_default'],
|
||||
$rabbit_heartbeat_in_pthread = $facts['os_service_default'],
|
||||
$rabbit_quorum_queue = $facts['os_service_default'],
|
||||
$rabbit_quorum_delivery_limit = $facts['os_service_default'],
|
||||
$rabbit_quorum_max_memory_length = $facts['os_service_default'],
|
||||
$rabbit_quorum_max_memory_bytes = $facts['os_service_default'],
|
||||
$kombu_ssl_version = $facts['os_service_default'],
|
||||
$kombu_ssl_keyfile = $facts['os_service_default'],
|
||||
$kombu_ssl_certfile = $facts['os_service_default'],
|
||||
$kombu_ssl_ca_certs = $facts['os_service_default'],
|
||||
$kombu_reconnect_delay = $facts['os_service_default'],
|
||||
$kombu_failover_strategy = $facts['os_service_default'],
|
||||
$kombu_compression = $facts['os_service_default'],
|
||||
$amqp_server_request_prefix = $facts['os_service_default'],
|
||||
$amqp_broadcast_prefix = $facts['os_service_default'],
|
||||
$amqp_group_request_prefix = $facts['os_service_default'],
|
||||
$amqp_container_name = $facts['os_service_default'],
|
||||
$amqp_idle_timeout = $facts['os_service_default'],
|
||||
$amqp_trace = $facts['os_service_default'],
|
||||
$amqp_ssl_ca_file = $facts['os_service_default'],
|
||||
$amqp_ssl_cert_file = $facts['os_service_default'],
|
||||
$amqp_ssl_key_file = $facts['os_service_default'],
|
||||
$amqp_ssl_key_password = $facts['os_service_default'],
|
||||
$amqp_sasl_mechanisms = $facts['os_service_default'],
|
||||
$amqp_sasl_config_dir = $facts['os_service_default'],
|
||||
$amqp_sasl_config_name = $facts['os_service_default'],
|
||||
$amqp_username = $facts['os_service_default'],
|
||||
$amqp_password = $facts['os_service_default'],
|
||||
Boolean $purge_config = false,
|
||||
$default_ntp_server = $facts['os_service_default'],
|
||||
) {
|
||||
|
||||
include sahara::deps
|
||||
|
@ -295,20 +317,24 @@ class sahara(
|
|||
}
|
||||
|
||||
oslo::messaging::rabbit { 'sahara_config':
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
kombu_failover_strategy => $kombu_failover_strategy,
|
||||
kombu_compression => $kombu_compression,
|
||||
kombu_reconnect_delay => $kombu_reconnect_delay,
|
||||
kombu_ssl_version => $kombu_ssl_version,
|
||||
kombu_ssl_keyfile => $kombu_ssl_keyfile,
|
||||
kombu_ssl_certfile => $kombu_ssl_certfile,
|
||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
rabbit_login_method => $rabbit_login_method,
|
||||
rabbit_retry_interval => $rabbit_retry_interval,
|
||||
rabbit_retry_backoff => $rabbit_retry_backoff,
|
||||
heartbeat_in_pthread => $rabbit_heartbeat_in_pthread,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
kombu_failover_strategy => $kombu_failover_strategy,
|
||||
kombu_compression => $kombu_compression,
|
||||
kombu_reconnect_delay => $kombu_reconnect_delay,
|
||||
kombu_ssl_version => $kombu_ssl_version,
|
||||
kombu_ssl_keyfile => $kombu_ssl_keyfile,
|
||||
kombu_ssl_certfile => $kombu_ssl_certfile,
|
||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
rabbit_login_method => $rabbit_login_method,
|
||||
rabbit_retry_interval => $rabbit_retry_interval,
|
||||
rabbit_retry_backoff => $rabbit_retry_backoff,
|
||||
heartbeat_in_pthread => $rabbit_heartbeat_in_pthread,
|
||||
rabbit_quorum_queue => $rabbit_quorum_queue,
|
||||
rabbit_quorum_delivery_limit => $rabbit_quorum_delivery_limit,
|
||||
rabbit_quorum_max_memory_length => $rabbit_quorum_max_memory_length,
|
||||
rabbit_quorum_max_memory_bytes => $rabbit_quorum_max_memory_bytes,
|
||||
}
|
||||
|
||||
oslo::messaging::amqp { 'sahara_config':
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The ``sahara`` class now supports options for quorum queues in RabbitMQ.
|
|
@ -34,13 +34,32 @@ describe 'sahara' do
|
|||
it { is_expected.to contain_sahara_config('DEFAULT/host').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/port').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/plugins').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_compression').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
it { is_expected.to contain_oslo__messaging__rabbit('sahara_config').with(
|
||||
:rabbit_use_ssl => '<SERVICE DEFAULT>',
|
||||
:heartbeat_timeout_threshold => '<SERVICE DEFAULT>',
|
||||
:heartbeat_rate => '<SERVICE DEFAULT>',
|
||||
:heartbeat_in_pthread => '<SERVICE DEFAULT>',
|
||||
:kombu_reconnect_delay => '<SERVICE DEFAULT>',
|
||||
:kombu_failover_strategy => '<SERVICE DEFAULT>',
|
||||
:amqp_durable_queues => '<SERVICE DEFAULT>',
|
||||
:kombu_compression => '<SERVICE DEFAULT>',
|
||||
:kombu_ssl_ca_certs => '<SERVICE DEFAULT>',
|
||||
:kombu_ssl_certfile => '<SERVICE DEFAULT>',
|
||||
:kombu_ssl_keyfile => '<SERVICE DEFAULT>',
|
||||
:kombu_ssl_version => '<SERVICE DEFAULT>',
|
||||
:rabbit_ha_queues => '<SERVICE DEFAULT>',
|
||||
:rabbit_retry_interval => '<SERVICE DEFAULT>',
|
||||
:rabbit_quorum_queue => '<SERVICE DEFAULT>',
|
||||
:rabbit_quorum_delivery_limit => '<SERVICE DEFAULT>',
|
||||
:rabbit_quorum_max_memory_length => '<SERVICE DEFAULT>',
|
||||
:rabbit_quorum_max_memory_bytes => '<SERVICE DEFAULT>',
|
||||
) }
|
||||
it { is_expected.to contain_oslo__messaging__default('sahara_config').with(
|
||||
:transport_url => '<SERVICE DEFAULT>',
|
||||
:rpc_response_timeout => '<SERVICE DEFAULT>',
|
||||
:control_exchange => '<SERVICE DEFAULT>'
|
||||
) }
|
||||
it { is_expected.to contain_sahara_config('DEFAULT/default_ntp_server').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
|
@ -67,30 +86,36 @@ describe 'sahara' do
|
|||
end
|
||||
|
||||
shared_examples 'sahara rpc' do
|
||||
|
||||
context 'when defaults with rabbit pass specified' do
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>') }
|
||||
end
|
||||
|
||||
context 'when passing params' do
|
||||
before do
|
||||
params.merge!({
|
||||
:rabbit_ha_queues => 'true',
|
||||
:amqp_durable_queues => 'true',
|
||||
:rabbit_heartbeat_in_pthread => 'true',
|
||||
:kombu_reconnect_delay => '1.0',
|
||||
:kombu_compression => 'gzip',
|
||||
:kombu_failover_strategy => 'round-robin',
|
||||
:rabbit_ha_queues => true,
|
||||
:amqp_durable_queues => true,
|
||||
:rabbit_heartbeat_in_pthread => true,
|
||||
:kombu_reconnect_delay => '1.0',
|
||||
:kombu_compression => 'gzip',
|
||||
:kombu_failover_strategy => 'round-robin',
|
||||
:rabbit_quorum_queue => true,
|
||||
:rabbit_quorum_delivery_limit => 3,
|
||||
:rabbit_quorum_max_memory_length => 5,
|
||||
:rabbit_quorum_max_memory_bytes => 1073741824,
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('true') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/heartbeat_in_pthread').with_value('true') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('1.0') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_compression').with_value('gzip') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('round-robin') }
|
||||
it { is_expected.to contain_oslo__messaging__rabbit('sahara_config').with(
|
||||
:rabbit_use_ssl => '<SERVICE DEFAULT>',
|
||||
:heartbeat_timeout_threshold => '<SERVICE DEFAULT>',
|
||||
:heartbeat_rate => '<SERVICE DEFAULT>',
|
||||
:heartbeat_in_pthread => true,
|
||||
:kombu_reconnect_delay => '1.0',
|
||||
:kombu_failover_strategy => 'round-robin',
|
||||
:amqp_durable_queues => true,
|
||||
:kombu_compression => 'gzip',
|
||||
:rabbit_quorum_queue => true,
|
||||
:rabbit_quorum_delivery_limit => 3,
|
||||
:rabbit_quorum_max_memory_length => 5,
|
||||
:rabbit_quorum_max_memory_bytes => 1073741824,
|
||||
) }
|
||||
end
|
||||
|
||||
context 'with rabbit ssl cert parameters' do
|
||||
|
@ -115,43 +140,34 @@ describe 'sahara' do
|
|||
context 'with rabbit ssl disabled' do
|
||||
before do
|
||||
params.merge!({
|
||||
:rabbit_use_ssl => false,
|
||||
:rabbit_use_ssl => false,
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_oslo__messaging__rabbit('sahara_config').with(
|
||||
:rabbit_use_ssl => false,
|
||||
:rabbit_use_ssl => false,
|
||||
)}
|
||||
end
|
||||
|
||||
context 'when passing params for single rabbit host' do
|
||||
before do
|
||||
params.merge!({
|
||||
:rabbit_ha_queues => true,
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') }
|
||||
end
|
||||
|
||||
context 'with amqp rpc' do
|
||||
|
||||
context 'with default parameters' do
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/container_name').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/trace').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_ca_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_cert_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_file').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_password').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_mechanisms').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_config_dir').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/sasl_config_name').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/username').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_oslo__messaging__amqp('sahara_config').with(
|
||||
:server_request_prefix => '<SERVICE DEFAULT>',
|
||||
:broadcast_prefix => '<SERVICE DEFAULT>',
|
||||
:group_request_prefix => '<SERVICE DEFAULT>',
|
||||
:container_name => '<SERVICE DEFAULT>',
|
||||
:idle_timeout => '<SERVICE DEFAULT>',
|
||||
:trace => '<SERVICE DEFAULT>',
|
||||
:ssl_ca_file => '<SERVICE DEFAULT>',
|
||||
:ssl_cert_file => '<SERVICE DEFAULT>',
|
||||
:ssl_key_file => '<SERVICE DEFAULT>',
|
||||
:sasl_mechanisms => '<SERVICE DEFAULT>',
|
||||
:sasl_config_dir => '<SERVICE DEFAULT>',
|
||||
:sasl_config_name => '<SERVICE DEFAULT>',
|
||||
:username => '<SERVICE DEFAULT>',
|
||||
:password => '<SERVICE DEFAULT>',
|
||||
)}
|
||||
end
|
||||
|
||||
context 'when pass parameters' do
|
||||
|
@ -167,13 +183,15 @@ describe 'sahara' do
|
|||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/idle_timeout').with_value('60') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/trace').with_value('true') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_ca_file').with_value('/etc/ca.cert') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_cert_file').with_value('/etc/certfile') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/ssl_key_file').with_value('/etc/key') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/username').with_value('amqp_user') }
|
||||
it { is_expected.to contain_sahara_config('oslo_messaging_amqp/password').with_value('password') }
|
||||
it { is_expected.to contain_oslo__messaging__amqp('sahara_config').with(
|
||||
:idle_timeout => '60',
|
||||
:trace => true,
|
||||
:ssl_ca_file => '/etc/ca.cert',
|
||||
:ssl_cert_file => '/etc/certfile',
|
||||
:ssl_key_file => '/etc/key',
|
||||
:username => 'amqp_user',
|
||||
:password => 'password',
|
||||
)}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue