From 7f595f01b10a59d8fc9df3509a765e8f722ee3eb Mon Sep 17 00:00:00 2001 From: ZhijunWei Date: Wed, 19 Sep 2018 08:20:41 -0400 Subject: [PATCH] Update messaging notification configuration This patch removes 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: Ib68aa2669b5d70626ed2777d5601d8914207451d Closes-Bug: #1794320 --- tasks/main.yml | 1 - templates/sahara.conf.j2 | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 6b755bb..a92401d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -58,7 +58,6 @@ _oslomsg_notify_password: "{{ sahara_oslomsg_notify_password }}" _oslomsg_notify_vhost: "{{ sahara_oslomsg_notify_vhost }}" _oslomsg_notify_transport: "{{ sahara_oslomsg_notify_transport }}" - _oslomsg_configure_notify: "{{ sahara_ceilometer_enabled | bool }}" tags: - common-mq - sahara-config diff --git a/templates/sahara.conf.j2 b/templates/sahara.conf.j2 index 215ac78..d2806fc 100644 --- a/templates/sahara.conf.j2 +++ b/templates/sahara.conf.j2 @@ -55,11 +55,9 @@ policy_default_rule = {{ sahara_policy_default_rule }} policy_dirs = {{ sahara_policy_dirs }} # Ceilometer options -{% if sahara_ceilometer_enabled %} [oslo_messaging_notifications] -driver = messagingv2 +driver = {% if sahara_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} transport_url = {{ sahara_oslomsg_notify_transport }}://{% for host in sahara_oslomsg_notify_servers.split(',') %}{{ sahara_oslomsg_notify_userid }}:{{ sahara_oslomsg_notify_password }}@{{ host }}:{{ sahara_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ sahara_oslomsg_notify_vhost }}{% if sahara_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} -{% endif %} [oslo_messaging_rabbit] ssl = {{ sahara_oslomsg_rpc_use_ssl }}