Update messaging notification configuration

This patch add the conditional inclusion of the notification
section of the service configuration. This ensures that oslo.messaging
notifications use the correct transport for deployments that have
separate rpc and notify messaging backends. For example, if the
transport_url is not provided in the notification section of the
service configuration, the transport_url specified in the default
section will be used instead.

This patch conditionally selects the notifier driver. The noop
driver will be selected when notification publishing is disabled.
The messagingv2 driver is selected when notification publishing is
enabled.

Change-Id: Ie5cc5499980f986f1a7e530adf42f4dcc43fbaca
Closes-Bug: #1794320
This commit is contained in:
ZhijunWei 2018-09-19 08:20:41 -04:00 committed by caoyuan
parent 8facdee36c
commit 3cdd0d103a
2 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,9 @@
## Verbosity Options
debug: False
# Enable/Disable Ceilometer
designate_ceilometer_enabled: False
# Set the host which will execute the shade modules
# for the service setup. The host must already have
# clouds.yaml properly configured.

View File

@ -33,6 +33,7 @@ rabbit_notification_exchange = designate
rabbit_notification_topic = notifications
[oslo_messaging_notifications]
driver = {% if designate_ceilometer_enabled %}messagingv2{% else %}noop{% endif %}
transport_url = {{ designate_oslomsg_notify_transport }}://{% for host in designate_oslomsg_notify_servers.split(',') %}{{ designate_oslomsg_notify_userid }}:{{ designate_oslomsg_notify_password }}@{{ host }}:{{ designate_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ designate_oslomsg_notify_vhost }}{% if designate_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
########################