diff --git a/ansible/roles/glance/defaults/main.yml b/ansible/roles/glance/defaults/main.yml index af772b5fda06259a3d1c26e4b7a41a5299fabd46..ed834d22943ed60154694e79e83725263b735099 100644 --- a/ansible/roles/glance/defaults/main.yml +++ b/ansible/roles/glance/defaults/main.yml @@ -23,6 +23,14 @@ glance_services: - "/etc/localtime:/etc/localtime:ro" - "kolla_logs:/var/log/kolla/" +#################### +# Notification +#################### +glance_notification_topics: + - name: notifications + enabled: "{{ enable_ceilometer | bool or enable_searchlight | bool }}" + +glance_enabled_notification_topics: "{{ glance_notification_topics | selectattr('enabled', 'equalto', true) | list }}" #################### # Ceph diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index 1258b800ca5313642022ec3e934edc31f74a50cc..a54dae97ce0022423f6934ed2d481c16888b3251 100644 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -83,8 +83,9 @@ vmware_insecure = True [oslo_messaging_notifications] transport_url = {{ notify_transport_url }} -{% if enable_ceilometer | bool or enable_searchlight | bool %} +{% if glance_enabled_notification_topics %} driver = messagingv2 +topics = {{ glance_enabled_notification_topics | map(attribute='name') | join(',') }} {% else %} driver = noop {% endif %} diff --git a/ansible/roles/glance/templates/glance-registry.conf.j2 b/ansible/roles/glance/templates/glance-registry.conf.j2 index 9a714b3a1222e6ac025e97c18b8c08e78c4d910c..537fe28d9c0f253bef5d23e15f061f1ee95a1ccc 100644 --- a/ansible/roles/glance/templates/glance-registry.conf.j2 +++ b/ansible/roles/glance/templates/glance-registry.conf.j2 @@ -33,8 +33,9 @@ flavor = keystone [oslo_messaging_notifications] transport_url = {{ notify_transport_url }} -{% if enable_ceilometer | bool or enable_searchlight | bool %} +{% if glance_enabled_notification_topics %} driver = messagingv2 +topics = {{ glance_enabled_notification_topics | map(attribute='name') | join(',') }} {% else %} driver = noop {% endif %}