Add default_transport_url option
Change-Id: I891570dde75dc58f45e5ad6386be9e522b2706eb
(cherry picked from commit 1b123d9be5
)
This commit is contained in:
parent
f39f5e1d38
commit
b59fc5506a
|
@ -1,6 +1,12 @@
|
|||
#
|
||||
# used to configure rabbitmq notifications for glance
|
||||
#
|
||||
# [*default_transport_url*]
|
||||
# (optional) A URL representing the messaging driver to use and its full
|
||||
# configuration. Transport URLs take the form:
|
||||
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*rabbit_password*]
|
||||
# (Optional) The RabbitMQ password. (string value)
|
||||
# Defaults to $::os_service_default
|
||||
|
@ -97,6 +103,7 @@
|
|||
# Defaults to $::os_service_default
|
||||
#
|
||||
class glance::notify::rabbitmq(
|
||||
$default_transport_url = $::os_service_default,
|
||||
$rabbit_password = $::os_service_default,
|
||||
$rabbit_userid = $::os_service_default,
|
||||
$rabbit_host = $::os_service_default,
|
||||
|
@ -141,6 +148,9 @@ class glance::notify::rabbitmq(
|
|||
kombu_compression => $kombu_compression,
|
||||
}
|
||||
|
||||
oslo::messaging::default { ['glance_api_config', 'glance_registry_config']:
|
||||
transport_url => $default_transport_url,
|
||||
}
|
||||
|
||||
oslo::messaging::notifications { ['glance_api_config', 'glance_registry_config']:
|
||||
driver => $notification_driver,
|
||||
|
|
|
@ -3,6 +3,7 @@ describe 'glance::notify::rabbitmq' do
|
|||
|
||||
shared_examples_for 'glance::notify::rabbitmq' do
|
||||
describe 'when defaults with rabbit pass specified' do
|
||||
it { is_expected.to contain_glance_api_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_api_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>').with_secret(true) }
|
||||
|
@ -19,6 +20,7 @@ describe 'glance::notify::rabbitmq' do
|
|||
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/heartbeat_rate').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_api_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
it { is_expected.to contain_glance_registry_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_registry_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_registry_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glance_registry_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>').with_secret(true) }
|
||||
|
@ -191,6 +193,16 @@ describe 'glance::notify::rabbitmq' do
|
|||
it { is_expected.to contain_glance_registry_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') }
|
||||
end
|
||||
|
||||
describe 'when passing params transport_url' do
|
||||
let :params do
|
||||
{
|
||||
:default_transport_url => 'rabbit://user:pass@host:1234/virt',
|
||||
}
|
||||
end
|
||||
it { is_expected.to contain_glance_api_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') }
|
||||
it { is_expected.to contain_glance_registry_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue