From 051038621f162b40c069e3be1daef8d9125c9fbb Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Thu, 2 Jul 2020 22:48:31 +0800 Subject: [PATCH] make barbican notification driver configurable barbican alway use default notification driver (defalt '') so we should change this value according to whether enable notification Change-Id: Ia17a64fe9bf31042369dec19f1f76b1ab8592288 --- ansible/roles/barbican/defaults/main.yml | 9 +++++++++ ansible/roles/barbican/templates/barbican.conf.j2 | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/ansible/roles/barbican/defaults/main.yml b/ansible/roles/barbican/defaults/main.yml index c09cac06ab..f0d846c9f6 100644 --- a/ansible/roles/barbican/defaults/main.yml +++ b/ansible/roles/barbican/defaults/main.yml @@ -145,6 +145,15 @@ barbican_ks_roles: - "{{ barbican_observer_role }}" - "{{ barbican_audit_role }}" +#################### +# Notification +#################### +barbican_notification_topics: + - name: notifications + enabled: "{{ enable_ceilometer | bool or enable_searchlight | bool }}" + +barbican_enabled_notification_topics: "{{ barbican_notification_topics | selectattr('enabled', 'equalto', true) | list }}" + #################### # TLS #################### diff --git a/ansible/roles/barbican/templates/barbican.conf.j2 b/ansible/roles/barbican/templates/barbican.conf.j2 index 89036675b0..c207318709 100644 --- a/ansible/roles/barbican/templates/barbican.conf.j2 +++ b/ansible/roles/barbican/templates/barbican.conf.j2 @@ -67,6 +67,12 @@ memcached_servers = {% for host in groups['memcached'] %}{{ 'api' | kolla_addres [oslo_messaging_notifications] transport_url = {{ notify_transport_url }} +{% if barbican_enabled_notification_topics %} +driver = messagingv2 +topics = {{ barbican_enabled_notification_topics | map(attribute='name') | join(',') }} +{% else %} +driver = noop +{% endif %} [oslo_middleware] enable_proxy_headers_parsing = True