Add notification_transport_url and notification_topics options
Add notification_transport_url to configure a URL representing the messaging driver to use for notifications. Add notification_topics to configure AMQP topic used for OpenStack notifications. Change-Id: I7cc3a008486724a3ce566a91fbada9a4d65d5748
This commit is contained in:
parent
8c723c26a3
commit
fa0dfc73f4
|
@ -8,6 +8,17 @@
|
|||
# (Optional) Ensure state for package
|
||||
# Defaults to 'present'
|
||||
#
|
||||
# [*notification_transport_url*]
|
||||
# (optional) A URL representing the messaging driver to use for notifications
|
||||
# and its full configuration. Transport URLs take the form:
|
||||
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*notification_topics*]
|
||||
# (optional) AMQP topics to publish to when using the RPC notification driver.
|
||||
# (list value)
|
||||
# Default to $::os_service_default
|
||||
#
|
||||
# [*notification_driver*]
|
||||
# (Optional) Notification driver to use
|
||||
# Defaults to $::os_service_default
|
||||
|
@ -87,25 +98,27 @@
|
|||
# Defaults to $::os_service_default
|
||||
#
|
||||
class magnum(
|
||||
$package_ensure = 'present',
|
||||
$notification_driver = $::os_service_default,
|
||||
$rpc_backend = 'rabbit',
|
||||
$default_transport_url = $::os_service_default,
|
||||
$rpc_response_timeout = $::os_service_default,
|
||||
$control_exchange = $::os_service_default,
|
||||
$rabbit_use_ssl = $::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,
|
||||
$purge_config = false,
|
||||
$package_ensure = 'present',
|
||||
$notification_transport_url = $::os_service_default,
|
||||
$notification_driver = $::os_service_default,
|
||||
$notification_topics = $::os_service_default,
|
||||
$rpc_backend = 'rabbit',
|
||||
$default_transport_url = $::os_service_default,
|
||||
$rpc_response_timeout = $::os_service_default,
|
||||
$control_exchange = $::os_service_default,
|
||||
$rabbit_use_ssl = $::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,
|
||||
$purge_config = false,
|
||||
# DEPRECATED PARAMTERS
|
||||
$rabbit_host = $::os_service_default,
|
||||
$rabbit_hosts = $::os_service_default,
|
||||
$rabbit_port = $::os_service_default,
|
||||
$rabbit_userid = $::os_service_default,
|
||||
$rabbit_virtual_host = $::os_service_default,
|
||||
$rabbit_password = $::os_service_default,
|
||||
$rabbit_host = $::os_service_default,
|
||||
$rabbit_hosts = $::os_service_default,
|
||||
$rabbit_port = $::os_service_default,
|
||||
$rabbit_userid = $::os_service_default,
|
||||
$rabbit_virtual_host = $::os_service_default,
|
||||
$rabbit_password = $::os_service_default,
|
||||
) {
|
||||
|
||||
include ::magnum::deps
|
||||
|
@ -154,7 +167,9 @@ class magnum(
|
|||
}
|
||||
|
||||
oslo::messaging::notifications { 'magnum_config':
|
||||
driver => $notification_driver
|
||||
transport_url => $notification_transport_url,
|
||||
driver => $notification_driver,
|
||||
topics => $notification_topics,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
features:
|
||||
- Add new parameter "notification_transport_url", A URL
|
||||
representing the messaging driver to use for notifications
|
||||
and its full configuration.
|
||||
- Add new parameter "notification_topics", AMQP topic used for
|
||||
OpenStack notifications.
|
|
@ -50,23 +50,27 @@ describe 'magnum' do
|
|||
end
|
||||
|
||||
it 'configures various things' do
|
||||
is_expected.to contain_magnum_config('DEFAULT/notification_driver').with_value('<SERVICE_DEFAULT>')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE_DEFAULT>')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/driver').with_value('<SERVICE_DEFAULT>')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/topics').with_value('<SERVICE_DEFAULT>')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'with overridden parameters' do
|
||||
let :params do
|
||||
{ :package_ensure => 'latest',
|
||||
:notification_driver => 'messagingv1',
|
||||
:transport_url => 'rabbit://user:pass@host:1234/virt',
|
||||
:rpc_response_timeout => '120',
|
||||
:control_exchange => 'magnum',
|
||||
:rabbit_host => '53.210.103.65',
|
||||
:rabbit_port => '1234',
|
||||
:rabbit_userid => 'me',
|
||||
:rabbit_password => 'secrete',
|
||||
:rabbit_virtual_host => 'vhost',
|
||||
{ :package_ensure => 'latest',
|
||||
:notification_transport_url => 'rabbit://user:pass@host:1234/virt',
|
||||
:notification_topics => 'openstack',
|
||||
:notification_driver => 'messagingv1',
|
||||
:transport_url => 'rabbit://user:pass@host:1234/virt',
|
||||
:rpc_response_timeout => '120',
|
||||
:control_exchange => 'magnum',
|
||||
:rabbit_host => '53.210.103.65',
|
||||
:rabbit_port => '1234',
|
||||
:rabbit_userid => 'me',
|
||||
:rabbit_password => 'secrete',
|
||||
:rabbit_virtual_host => 'vhost',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -90,7 +94,9 @@ describe 'magnum' do
|
|||
end
|
||||
|
||||
it 'configures various things' do
|
||||
is_expected.to contain_magnum_config('DEFAULT/notification_driver').with_value('messagingv1')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/transport_url').with_value('rabbit://user:pass@host:1234/virt')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/driver').with_value('messagingv1')
|
||||
is_expected.to contain_magnum_config('oslo_messaging_notifications/topics').with_value('openstack')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue