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: Ib5d4f174be922f9b6f5ece35128a604fddb58e59
This commit is contained in:
Dmitriy Rabotyagov 2024-05-10 17:03:04 +02:00
parent 82d439c3fb
commit 97c408e19d
3 changed files with 4 additions and 2 deletions

View File

@ -153,6 +153,7 @@ nova_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }
nova_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
nova_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(nova_ceilometer_enabled) }}"
nova_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
nova_oslomsg_notify_setup_host: "{{ (nova_oslomsg_notify_host_group in groups) | ternary(groups[nova_oslomsg_notify_host_group][0], 'localhost') }}"
nova_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"

View File

@ -104,6 +104,7 @@
_oslomsg_notify_vhost: "{{ nova_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ nova_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ nova_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ nova_oslomsg_notify_configure }}"
tags:
- always

View File

@ -39,7 +39,7 @@ my_ip = {{ _nova_my_ip }}
default_ephemeral_format = ext4
# Ceilometer notification configurations
{% if nova_ceilometer_enabled %}
{% if nova_oslomsg_notify_configure %}
instance_usage_audit = True
instance_usage_audit_period = hour
{% endif %}
@ -47,7 +47,7 @@ instance_usage_audit_period = hour
# Notifications
[oslo_messaging_notifications]
{% set notification_topics = [] %}
{% if nova_ceilometer_enabled %}
{% if nova_oslomsg_notify_configure %}
{% set _ = notification_topics.append('notifications') %}
{% endif %}
{% if nova_designate_enabled %}