Add kombu_failover_strategy option

Adds the kombu_failover_strategy option for configuring
oslo.messaging.rabbit. This will determines how the next RabbitMQ node
is chosen in case the one we are currently connected to becomes
unavailable.

Change-Id: If59b301e533a509051876ed88f410c5101425ec2
Closes-Bug: #1748353
This commit is contained in:
ZhongShengping 2018-02-09 15:05:28 +08:00
parent c147502937
commit ccf6a66e1f
10 changed files with 77 additions and 56 deletions

View File

@ -303,6 +303,7 @@ the future release. Please use trove::api::package_ensure instead.")
rabbit_virtual_host => $::trove::rabbit_virtual_host,
rabbit_use_ssl => $::trove::rabbit_use_ssl,
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
kombu_failover_strategy => $::trove::kombu_failover_strategy,
amqp_durable_queues => $::trove::amqp_durable_queues,
kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
kombu_ssl_certfile => $::trove::kombu_ssl_certfile,

View File

@ -162,6 +162,7 @@ the future release. Please use trove::conductor::package_ensure instead.")
rabbit_virtual_host => $::trove::rabbit_virtual_host,
rabbit_use_ssl => $::trove::rabbit_use_ssl,
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
kombu_failover_strategy => $::trove::kombu_failover_strategy,
amqp_durable_queues => $::trove::amqp_durable_queues,
kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
kombu_ssl_certfile => $::trove::kombu_ssl_certfile,

View File

@ -204,6 +204,7 @@ trove::control_exchange instead.")
rabbit_password => $::trove::rabbit_password,
rabbit_virtual_host => $::trove::rabbit_virtual_host,
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
kombu_failover_strategy => $::trove::kombu_failover_strategy,
amqp_durable_queues => $::trove::amqp_durable_queues,
kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
kombu_ssl_certfile => $::trove::kombu_ssl_certfile,

View File

@ -78,6 +78,12 @@
# consumer cancel notification.
# Defaults to $::os_service_default
#
# [*kombu_failover_strategy*]
# (Optional) Determines how the next RabbitMQ node is chosen in case the one
# we are currently connected to becomes unavailable. Takes effect only if
# more than one RabbitMQ node is provided in config. (string value)
# Defaults to $::os_service_default
#
# [*amqp_durable_queues*]
# (optional) Define queues as "durable" to rabbitmq.
# Defaults to $::os_service_default
@ -306,6 +312,7 @@ class trove(
$kombu_ssl_keyfile = $::os_service_default,
$kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default,
$kombu_failover_strategy = $::os_service_default,
$amqp_durable_queues = $::os_service_default,
$amqp_server_request_prefix = $::os_service_default,
$amqp_broadcast_prefix = $::os_service_default,

View File

@ -218,6 +218,7 @@ the future release. Please use trove::default_neutron_networks instead.")
rabbit_virtual_host => $::trove::rabbit_virtual_host,
rabbit_use_ssl => $::trove::rabbit_use_ssl,
kombu_reconnect_delay => $::trove::kombu_reconnect_delay,
kombu_failover_strategy => $::trove::kombu_failover_strategy,
amqp_durable_queues => $::trove::amqp_durable_queues,
kombu_ssl_ca_certs => $::trove::kombu_ssl_ca_certs,
kombu_ssl_certfile => $::trove::kombu_ssl_certfile,

View File

@ -0,0 +1,6 @@
---
features:
- |
Adds the kombu_failover_strategy option for configuring oslo.messaging.rabbit.
This will determines how the next RabbitMQ node is chosen in case the one we
are currently connected to becomes unavailable.

View File

@ -92,6 +92,7 @@ describe 'trove::api' do
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('ssl/cert_file').with_ensure('absent')
is_expected.to contain_trove_config('ssl/key_file').with_ensure('absent')

View File

@ -39,6 +39,7 @@ describe 'trove::conductor' do
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/trove_conductor_workers').with_value('8')
is_expected.to contain_trove_conductor_config('profiler/enabled').with_value('<SERVICE DEFAULT>')

View File

@ -44,6 +44,7 @@ describe 'trove::guestagent' do
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/swift_service_type').with_value('<SERVICE DEFAULT>')

View File

@ -75,6 +75,7 @@ describe 'trove::taskmanager' do
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__messaging__rabbit('trove_taskmanager_config').with(
:rabbit_use_ssl => '<SERVICE DEFAULT>',