Use oslo module for messaging (rabbit) configuration
Additonal changes: * switch messaging related parameters to $::os_service_default as they are used in oslo::messaging_rabbit define * update unit tests * fix values for boolean variables * specify type for each parameter Change-Id: I9d03db24fafdd1f5fd2141cdc599b3ab212a04d8
This commit is contained in:
parent
f0709b7d23
commit
94c3bbed71
@ -69,78 +69,85 @@
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*rabbit_host*]
|
||||
# (optional) Location of rabbitmq installation.
|
||||
# (optional) Location of rabbitmq installation. (string value)
|
||||
# Defaults to 'localhost'
|
||||
#
|
||||
# [*rabbit_hosts*]
|
||||
# (optional) List of clustered rabbit servers.
|
||||
# Defaults to undef
|
||||
# (optional) List of clustered rabbit servers. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_port*]
|
||||
# (optional) Port for rabbitmq instance.
|
||||
# Defaults to '5672'
|
||||
# (optional) Port for rabbitmq instance. (port value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_password*]
|
||||
# (optional) Password used to connect to rabbitmq.
|
||||
# Defaults to 'guest'
|
||||
# (optional) Password used to connect to rabbitmq. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_userid*]
|
||||
# (optional) User used to connect to rabbitmq.
|
||||
# Defaults to 'guest'
|
||||
# (optional) User used to connect to rabbitmq. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_virtual_host*]
|
||||
# (optional) The RabbitMQ virtual host.
|
||||
# Defaults to '/'
|
||||
# (optional) The RabbitMQ virtual host. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_use_ssl*]
|
||||
# (optional) Connect over SSL for RabbitMQ
|
||||
# Defaults to false
|
||||
# (optional) Boolean. Connect over SSL for RabbitMQ. (boolean value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_ha_queues*]
|
||||
# (optional) Use HA queues in RabbitMQ.
|
||||
# Defaults to undef
|
||||
# (optional) Use HA queues in RabbitMQ. (boolean value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_heartbeat_timeout_threshold*]
|
||||
# (optional) Number of seconds after which the RabbitMQ broker is considered
|
||||
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
|
||||
# Heartbeating helps to ensure the TCP connection to RabbitMQ isn't silently
|
||||
# closed, resulting in missed or lost messages from the queue.
|
||||
# (Requires kombu >= 3.0.7 and amqp >= 1.4.0)
|
||||
# Defaults to 0
|
||||
# Requires kombu >= 3.0.7 and amqp >= 1.4.0. (integer value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_heartbeat_rate*]
|
||||
# (optional) How often during the rabbit_heartbeat_timeout_threshold period to
|
||||
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
|
||||
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
|
||||
# every 30 seconds.
|
||||
# Defaults to 2
|
||||
# (optional) How often during the rabbit_heartbeat_timeout_threshold period
|
||||
# to check the heartbeat on RabbitMQ connection.
|
||||
# i.e. rabbit_heartbeat_rate=2 when rabbit_heartbeat_timeout_threshold=60,
|
||||
# the heartbeat will be checked every 30 seconds. (integer value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_ca_certs*]
|
||||
# (optional) SSL certification authority file (valid only if SSL enabled).
|
||||
# Defaults to undef
|
||||
# (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_certfile*]
|
||||
# (optional) SSL cert file (valid only if SSL enabled).
|
||||
# Defaults to undef
|
||||
# (optional) SSL cert file (valid only if SSL enabled). (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_ssl_keyfile*]
|
||||
# (optional) SSL key file (valid only if SSL enabled).
|
||||
# Defaults to undef
|
||||
# (optional) SSL key file (valid only if SSL enabled). (string value)
|
||||
# Defaults to $::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
|
||||
# available on some distributions.
|
||||
# Defaults to 'TLSv1'
|
||||
# available on some distributions. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_reconnect_delay*]
|
||||
# (optional) How long to wait before reconnecting in response to an AMQP
|
||||
# consumer cancel notification.
|
||||
# Defaults to '1.0'
|
||||
# consumer cancel notification. (floating point value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*kombu_compression*]
|
||||
# (optional) Possible values are: gzip, bz2. If not set compression will not
|
||||
# be used. This option may notbe available in future versions. EXPERIMENTAL.
|
||||
# (string value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*amqp_durable_queues*]
|
||||
# (optional) Define queues as "durable" to rabbitmq.
|
||||
# Defaults to false
|
||||
# (optional) Define queues as "durable" to rabbitmq. (boolean value)
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*auth_strategy*]
|
||||
# (optional) The strategy to use for auth: noauth or keystone.
|
||||
@ -354,28 +361,29 @@ class nova(
|
||||
$database_max_retries = undef,
|
||||
$database_retry_interval = undef,
|
||||
$database_max_overflow = undef,
|
||||
$rpc_backend = 'rabbit',
|
||||
$rpc_backend = $::os_service_default,
|
||||
$image_service = 'nova.image.glance.GlanceImageService',
|
||||
# these glance params should be optional
|
||||
# this should probably just be configured as a glance client
|
||||
$glance_api_servers = 'http://localhost:9292',
|
||||
$memcached_servers = $::os_service_default,
|
||||
$rabbit_host = 'localhost',
|
||||
$rabbit_hosts = undef,
|
||||
$rabbit_password = 'guest',
|
||||
$rabbit_port = '5672',
|
||||
$rabbit_userid = 'guest',
|
||||
$rabbit_virtual_host = '/',
|
||||
$rabbit_use_ssl = false,
|
||||
$rabbit_heartbeat_timeout_threshold = 0,
|
||||
$rabbit_heartbeat_rate = 2,
|
||||
$rabbit_ha_queues = undef,
|
||||
$kombu_ssl_ca_certs = undef,
|
||||
$kombu_ssl_certfile = undef,
|
||||
$kombu_ssl_keyfile = undef,
|
||||
$kombu_ssl_version = 'TLSv1',
|
||||
$kombu_reconnect_delay = '1.0',
|
||||
$amqp_durable_queues = false,
|
||||
$rabbit_host = $::os_service_default,
|
||||
$rabbit_hosts = $::os_service_default,
|
||||
$rabbit_password = $::os_service_default,
|
||||
$rabbit_port = $::os_service_default,
|
||||
$rabbit_userid = $::os_service_default,
|
||||
$rabbit_virtual_host = $::os_service_default,
|
||||
$rabbit_use_ssl = $::os_service_default,
|
||||
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
|
||||
$rabbit_heartbeat_rate = $::os_service_default,
|
||||
$rabbit_ha_queues = $::os_service_default,
|
||||
$kombu_ssl_ca_certs = $::os_service_default,
|
||||
$kombu_ssl_certfile = $::os_service_default,
|
||||
$kombu_ssl_keyfile = $::os_service_default,
|
||||
$kombu_ssl_version = $::os_service_default,
|
||||
$kombu_reconnect_delay = $::os_service_default,
|
||||
$kombu_compression = $::os_service_default,
|
||||
$amqp_durable_queues = $::os_service_default,
|
||||
$auth_strategy = 'keystone',
|
||||
$service_down_time = 60,
|
||||
$log_dir = undef,
|
||||
@ -444,19 +452,6 @@ class nova(
|
||||
}
|
||||
}
|
||||
|
||||
if $kombu_ssl_ca_certs and !$rabbit_use_ssl {
|
||||
fail('The kombu_ssl_ca_certs parameter requires rabbit_use_ssl to be set to true')
|
||||
}
|
||||
if $kombu_ssl_certfile and !$rabbit_use_ssl {
|
||||
fail('The kombu_ssl_certfile parameter requires rabbit_use_ssl to be set to true')
|
||||
}
|
||||
if $kombu_ssl_keyfile and !$rabbit_use_ssl {
|
||||
fail('The kombu_ssl_keyfile parameter requires rabbit_use_ssl to be set to true')
|
||||
}
|
||||
if ($kombu_ssl_certfile and !$kombu_ssl_keyfile) or ($kombu_ssl_keyfile and !$kombu_ssl_certfile) {
|
||||
fail('The kombu_ssl_certfile and kombu_ssl_keyfile parameters must be used together')
|
||||
}
|
||||
|
||||
if $nova_public_key or $nova_private_key {
|
||||
file { '/var/lib/nova/.ssh':
|
||||
ensure => directory,
|
||||
@ -544,71 +539,28 @@ class nova(
|
||||
|
||||
# we keep "nova.openstack.common.rpc.impl_kombu" for backward compatibility
|
||||
# but since Icehouse, "rabbit" is enough.
|
||||
if $rpc_backend == 'nova.openstack.common.rpc.impl_kombu' or $rpc_backend == 'rabbit' {
|
||||
# I may want to support exporting and collecting these
|
||||
nova_config {
|
||||
'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true;
|
||||
'oslo_messaging_rabbit/rabbit_userid': value => $rabbit_userid;
|
||||
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
|
||||
'oslo_messaging_rabbit/heartbeat_timeout_threshold': value => $rabbit_heartbeat_timeout_threshold;
|
||||
'oslo_messaging_rabbit/heartbeat_rate': value => $rabbit_heartbeat_rate;
|
||||
'oslo_messaging_rabbit/kombu_reconnect_delay': value => $kombu_reconnect_delay;
|
||||
'oslo_messaging_rabbit/amqp_durable_queues': value => $amqp_durable_queues;
|
||||
}
|
||||
|
||||
if $rabbit_use_ssl {
|
||||
|
||||
if $kombu_ssl_ca_certs {
|
||||
nova_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; }
|
||||
} else {
|
||||
nova_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; }
|
||||
}
|
||||
|
||||
if $kombu_ssl_certfile or $kombu_ssl_keyfile {
|
||||
nova_config {
|
||||
'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile;
|
||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile;
|
||||
}
|
||||
} else {
|
||||
nova_config {
|
||||
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
|
||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $kombu_ssl_version {
|
||||
nova_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; }
|
||||
} else {
|
||||
nova_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; }
|
||||
}
|
||||
|
||||
} else {
|
||||
nova_config {
|
||||
'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent;
|
||||
'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent;
|
||||
'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent;
|
||||
'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent;
|
||||
}
|
||||
}
|
||||
|
||||
if $rabbit_hosts {
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($rabbit_hosts, ',') }
|
||||
} else {
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host }
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port }
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" }
|
||||
}
|
||||
|
||||
if $rabbit_ha_queues == undef {
|
||||
if $rabbit_hosts {
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true }
|
||||
} else {
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false }
|
||||
}
|
||||
} else {
|
||||
nova_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => $rabbit_ha_queues }
|
||||
if $rpc_backend in [$::os_service_default, 'nova.openstack.common.rpc.impl_kombu', 'rabbit'] {
|
||||
oslo::messaging::rabbit {'nova_config':
|
||||
rabbit_password => $rabbit_password,
|
||||
rabbit_userid => $rabbit_userid,
|
||||
rabbit_virtual_host => $rabbit_virtual_host,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||
heartbeat_rate => $rabbit_heartbeat_rate,
|
||||
kombu_reconnect_delay => $kombu_reconnect_delay,
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
kombu_compression => $kombu_compression,
|
||||
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
|
||||
kombu_ssl_certfile => $kombu_ssl_certfile,
|
||||
kombu_ssl_keyfile => $kombu_ssl_keyfile,
|
||||
kombu_ssl_version => $kombu_ssl_version,
|
||||
rabbit_hosts => $rabbit_hosts,
|
||||
rabbit_host => $rabbit_host,
|
||||
rabbit_port => $rabbit_port,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
}
|
||||
} else {
|
||||
nova_config { 'DEFAULT/rpc_backend': value => $rpc_backend }
|
||||
}
|
||||
|
||||
# we keep "nova.openstack.common.rpc.impl_qpid" for backward compatibility
|
||||
@ -657,7 +609,6 @@ class nova(
|
||||
|
||||
nova_config {
|
||||
'cinder/catalog_info': value => $cinder_catalog_info;
|
||||
'DEFAULT/rpc_backend': value => $rpc_backend;
|
||||
'DEFAULT/notification_topics': value => $notification_topics;
|
||||
'DEFAULT/notify_api_faults': value => $notify_api_faults;
|
||||
# Following may need to be broken out to different nova services
|
||||
|
@ -40,6 +40,7 @@
|
||||
{ "name": "openstack/keystone", "version_requirement": ">=8.0.0 <9.0.0" },
|
||||
{ "name": "puppetlabs/rabbitmq", "version_requirement": ">=2.0.2 <6.0.0" },
|
||||
{ "name": "puppetlabs/stdlib", "version_requirement": ">=4.0.0 <5.0.0" },
|
||||
{ "name": "openstack/openstacklib", "version_requirement": ">=8.0.0 <9.0.0" }
|
||||
{ "name": "openstack/openstacklib", "version_requirement": ">=8.0.0 <9.0.0" },
|
||||
{ "name": "openstack/oslo", "version_requirement": "<9.0.0" }
|
||||
]
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- Use oslo module for messaging (rabbit) configuration.
|
||||
Messaging related parameters were switched to $::os_service_default.
|
||||
Docs string for parameter were updated according to oslo module.
|
@ -43,13 +43,13 @@ describe 'nova' do
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('localhost')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_password').with_value('guest').with_secret(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('5672')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_userid').with_value('guest')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('/')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>').with_secret(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
it 'configures various things' do
|
||||
@ -83,11 +83,11 @@ describe 'nova' do
|
||||
:debug => true,
|
||||
:log_dir => '/var/log/nova2',
|
||||
:image_service => 'nova.image.local.LocalImageService',
|
||||
:rpc_backend => 'rabbit',
|
||||
:rabbit_host => 'rabbit',
|
||||
:rabbit_userid => 'rabbit_user',
|
||||
:rabbit_port => '5673',
|
||||
:rabbit_password => 'password',
|
||||
:rabbit_ha_queues => 'undef',
|
||||
:rabbit_heartbeat_timeout_threshold => '60',
|
||||
:rabbit_heartbeat_rate => '10',
|
||||
:lock_path => '/var/locky/path',
|
||||
@ -135,7 +135,7 @@ describe 'nova' do
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_password').with_value('password').with_secret(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('5673')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_userid').with_value('rabbit_user')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('/')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
|
||||
end
|
||||
@ -214,17 +214,18 @@ describe 'nova' do
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_port')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('1.0')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_compression').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
@ -234,13 +235,13 @@ describe 'nova' do
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_port')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_hosts').with_value('rabbit:5673')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('1.0')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(false)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
@ -256,7 +257,7 @@ describe 'nova' do
|
||||
|
||||
context 'with rabbit_ha_queues set to true' do
|
||||
let :params do
|
||||
{ :rabbit_ha_queues => 'true' }
|
||||
{ :rabbit_ha_queues => true }
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
@ -278,27 +279,27 @@ describe 'nova' do
|
||||
context 'with amqp_durable_queues parameter' do
|
||||
let :params do
|
||||
{ :rabbit_hosts => ['rabbit:5673'],
|
||||
:amqp_durable_queues => 'true' }
|
||||
:amqp_durable_queues => true }
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_host')
|
||||
is_expected.to_not contain_nova_config('oslo_messaging_rabbit/rabbit_port')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_hosts').with_value('rabbit:5673')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(false)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with rabbit ssl enabled with kombu' do
|
||||
let :params do
|
||||
{ :rabbit_hosts => ['rabbit:5673'],
|
||||
:rabbit_use_ssl => 'true',
|
||||
:rabbit_use_ssl => true,
|
||||
:kombu_ssl_ca_certs => '/etc/ca.cert',
|
||||
:kombu_ssl_certfile => '/etc/certfile',
|
||||
:kombu_ssl_keyfile => '/etc/key',
|
||||
@ -317,33 +318,15 @@ describe 'nova' do
|
||||
context 'with rabbit ssl enabled without kombu' do
|
||||
let :params do
|
||||
{ :rabbit_hosts => ['rabbit:5673'],
|
||||
:rabbit_use_ssl => 'true', }
|
||||
:rabbit_use_ssl => true, }
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value(true)
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with rabbit ssl disabled' do
|
||||
let :params do
|
||||
{
|
||||
:rabbit_password => 'pass',
|
||||
:rabbit_use_ssl => false,
|
||||
:kombu_ssl_version => 'TLSv1',
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
@ -352,7 +335,7 @@ describe 'nova' do
|
||||
{ :rpc_backend => 'nova.openstack.common.rpc.impl_kombu' }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('nova.openstack.common.rpc.impl_kombu') }
|
||||
it { is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit') }
|
||||
end
|
||||
|
||||
context 'with ssh public key' do
|
||||
|
Loading…
x
Reference in New Issue
Block a user