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: I63f5b887608f4c43e1fa953fbc194414d9bebc30
This commit is contained in:
Dmitriy Rabotyagov 2024-05-10 16:46:38 +02:00
parent f65cf84486
commit 5a692ce993
3 changed files with 3 additions and 1 deletions

View File

@ -87,6 +87,7 @@ tacker_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2')
tacker_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
tacker_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(tacker_ceilometer_enabled) }}"
tacker_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
tacker_oslomsg_notify_setup_host: "{{ (tacker_oslomsg_notify_host_group in groups) | ternary(groups[tacker_oslomsg_notify_host_group][0], 'localhost') }}"
tacker_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"

View File

@ -74,6 +74,7 @@
_oslomsg_notify_vhost: "{{ tacker_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ tacker_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ tacker_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ tacker_oslomsg_notify_configure }}"
tags:
- always

View File

@ -101,5 +101,5 @@ rabbit_quorum_delivery_limit = {{ tacker_oslomsg_rabbit_quorum_delivery_limit }}
rabbit_quorum_max_memory_bytes = {{ tacker_oslomsg_rabbit_quorum_max_memory_bytes }}
[oslo_messaging_notifications]
driver = {{ (tacker_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}
driver = {{ (tacker_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ tacker_oslomsg_notify_transport }}://{% for host in tacker_oslomsg_notify_servers.split(',') %}{{ tacker_oslomsg_notify_userid }}:{{ tacker_oslomsg_notify_password }}@{{ host }}:{{ tacker_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _tacker_oslomsg_notify_vhost_conf }}{% if tacker_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ tacker_oslomsg_notify_ssl_version }}&ssl_ca_file={{ tacker_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}