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: I2b4c4a119fa300fb5b64eaaf947e3c688bdb6e84
Closes-Bug: #1794320
This commit is contained in:
ZhijunWei 2018-09-19 08:20:48 -04:00 committed by weizj
parent 17bfd0b7ff
commit 6703cf06dd
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@ blazar_git_repo: https://git.openstack.org/openstack/blazar
blazar_git_install_branch: master
blazar_developer_mode: false
# Enable/Disable Ceilometer
blazar_ceilometer_enabled: False
# TODO(odyssey4me):
# This can be simplified once all the roles are using
# python_venv_build. We can then switch to using a

View File

@ -11,6 +11,7 @@ transport_url = {{ blazar_oslomsg_rpc_transport }}://{% for host in blazar_oslom
ssl = {{ blazar_oslomsg_notify_use_ssl | bool }}
[oslo_messaging_notifications]
driver = {% if blazar_ceilometer_enabled %}messagingv2{% else %}noop{% endif %}
transport_url = {{ blazar_oslomsg_notify_transport }}://{% for host in blazar_oslomsg_notify_servers.split(',') %}{{ blazar_oslomsg_notify_userid }}:{{ blazar_oslomsg_notify_password }}@{{ host }}:{{ blazar_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ blazar_oslomsg_notify_vhost }}{% if (blazar_oslomsg_notify_use_ssl | lower) | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
@ -27,4 +28,4 @@ password={{ blazar_service_password }}
auth_url={{ keystone_service_adminuri }}
[database]
connection = mysql+pymysql://{{ blazar_galera_user }}:{{ blazar_container_mysql_password }}@{{ blazar_galera_address }}/{{ blazar_galera_database }}?charset=utf8{% if blazar_galera_use_ssl | bool %}&ssl_ca={{ blazar_galera_ssl_ca_cert }}{% endif %}
connection = mysql+pymysql://{{ blazar_galera_user }}:{{ blazar_container_mysql_password }}@{{ blazar_galera_address }}/{{ blazar_galera_database }}?charset=utf8{% if blazar_galera_use_ssl | bool %}&ssl_ca={{ blazar_galera_ssl_ca_cert }}{% endif %}