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: Id9bc7f2ba4a2e813657d65f2bb6be5089c1a5461
This commit is contained in:
Dmitriy Rabotyagov 2024-05-10 16:21:46 +02:00
parent e85299f413
commit 053b2f8f5b
3 changed files with 3 additions and 1 deletions

View File

@ -121,6 +121,7 @@ octavia_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2'
octavia_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
octavia_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(octavia_ceilometer_enabled) }}"
octavia_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
octavia_oslomsg_notify_setup_host: >-
{{ (octavia_oslomsg_notify_host_group in groups) | ternary(groups[octavia_oslomsg_notify_host_group][0], 'localhost') }}

View File

@ -100,6 +100,7 @@
_oslomsg_notify_vhost: "{{ octavia_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ octavia_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ octavia_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ octavia_oslomsg_notify_configure }}"
tags:
- always

View File

@ -28,7 +28,7 @@ rabbit_quorum_delivery_limit = {{ octavia_oslomsg_rabbit_quorum_delivery_limit }
rabbit_quorum_max_memory_bytes = {{ octavia_oslomsg_rabbit_quorum_max_memory_bytes }}
[oslo_messaging_notifications]
driver = {{ (octavia_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}
driver = {{ (octavia_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ octavia_oslomsg_notify_transport }}://{% for host in octavia_oslomsg_notify_servers.split(',') %}{{ octavia_oslomsg_notify_userid }}:{{ octavia_oslomsg_notify_password }}@{{ host }}:{{ octavia_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _octavia_oslomsg_notify_vhost_conf }}{% if octavia_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ octavia_oslomsg_notify_ssl_version }}&ssl_ca_file={{ octavia_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[database]