Add notification_driver option

Add notification_driver to configure driver or drivers for handling
sending notifications.

Change-Id: Id6450967f8efd30597b0b3a23602fa8d673aec8a
This commit is contained in:
ZhongShengping 2017-02-13 17:39:44 +08:00
parent 840efb3bd6
commit c3d330eeb5
3 changed files with 74 additions and 60 deletions

View File

@ -26,6 +26,11 @@
# (Optional) AMQP topic used for OpenStack notifications (list value)
# Defaults to 'notifications'.
#
# [*notification_driver*]
# (optional) Driver or drivers to handle sending notifications.
# Value can be a string or a list.
# Defaults to $::os_service_default
#
# [*package_ensure*]
# (Optional) ensure state for package.
# Defaults to 'present'.
@ -74,11 +79,11 @@
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# The messaging driver to use, defaults to rabbit. Other drivers include
# (optional) The messaging driver to use, defaults to rabbit. Other drivers include
# amqp and zmq. (string value)
# Default to $::os_service_default
#
#
# [*rabbit_ha_queues*]
# (Optional) Use HA queues in RabbitMQ (x-ha-policy: all). If you change this
# option, you must wipe the RabbitMQ database. (boolean value)
@ -246,6 +251,7 @@ class ceilometer(
$metering_time_to_live = '-1',
$telemetry_secret = false,
$notification_topics = ['notifications'],
$notification_driver = $::os_service_default,
$package_ensure = 'present',
$debug = undef,
$log_dir = undef,
@ -407,6 +413,7 @@ deprecated. Please use ceilometer::default_transport_url instead.")
oslo::messaging::notifications { 'ceilometer_config':
transport_url => $notification_transport_url,
topics => $notification_topics,
driver => $notification_driver,
}
oslo::messaging::default { 'ceilometer_config':

View File

@ -0,0 +1,4 @@
---
features:
- Add new parameter "notification_driver", driver or drivers to
handle sending notifications. Value can be a string or a list.

View File

@ -130,6 +130,7 @@ describe 'ceilometer' do
it 'configures notifications' do
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/topics').with_value('notifications')
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
end
@ -158,12 +159,14 @@ describe 'ceilometer' do
before {
params.merge!(
:notification_topics => ['notifications', 'custom'],
:notification_driver => 'messagingv1',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
)
}
it 'configures notifications' do
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/topics').with_value('notifications,custom')
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/driver').with_value('messagingv1')
is_expected.to contain_ceilometer_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
end
end