From 32db8f9d85f145bc003bb756f5c008c5ee74ea53 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 10 May 2024 15:17:40 +0200 Subject: [PATCH] Add variable to globally control notifications enablement In order to be able to globally enable notification reporting for all services, without an need to have ceilometer deployed or bunch of overrides for each service, we add `oslomsg_notify_enabled` variable that aims to control behaviour of enabled notifications. Presence of ceilometer is still respected by default and being referenced. Potential usecase are various billing panels that do rely on notifications but do not require presence of Ceilometer. Change-Id: Idd3bb9a0ab58307b6acced6dd60fce3adf17b138 --- defaults/main.yml | 2 +- tasks/main.yml | 1 + templates/neutron.conf.j2 | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 666cc53e..9013cc44 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -272,7 +272,7 @@ neutron_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2' neutron_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}" # Notify - +neutron_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(neutron_ceilometer_enabled) }}" neutron_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}" neutron_oslomsg_notify_setup_host: >- {{ (neutron_oslomsg_notify_host_group in groups) | ternary(groups[neutron_oslomsg_notify_host_group][0], 'localhost') }} diff --git a/tasks/main.yml b/tasks/main.yml index e38f16ca..506119a2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -81,6 +81,7 @@ _oslomsg_notify_vhost: "{{ neutron_oslomsg_notify_vhost }}" _oslomsg_notify_transport: "{{ neutron_oslomsg_notify_transport }}" _oslomsg_notify_policies: "{{ neutron_oslomsg_notify_policies }}" + _oslomsg_notify_configure: "{{ neutron_oslomsg_notify_configure }}" tags: - always diff --git a/templates/neutron.conf.j2 b/templates/neutron.conf.j2 index 3ae8b0c9..5dd49988 100644 --- a/templates/neutron.conf.j2 +++ b/templates/neutron.conf.j2 @@ -254,7 +254,7 @@ rabbit_quorum_max_memory_bytes = {{ neutron_oslomsg_rabbit_quorum_max_memory_byt # Notifications [oslo_messaging_notifications] {% set notification_topics = [] %} -{% if neutron_ceilometer_enabled %} +{% if neutron_oslomsg_notify_configure %} {% set _ = notification_topics.append('notifications') %} {% endif %} topics = {{ notification_topics | join(',') }}