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.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/914144
Change-Id: I85480e8a176abea22a1cfe167056fc163d2e6992
This commit is contained in:
Dmitriy Rabotyagov 2024-05-02 14:09:59 +02:00 committed by Dmitriy Rabotyagov
parent 9311b16c13
commit f694169e6f
3 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,7 @@ aodh_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2') }
aodh_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
aodh_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(True) }}"
aodh_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
aodh_oslomsg_notify_setup_host: "{{ (aodh_oslomsg_notify_host_group in groups) | ternary(groups[aodh_oslomsg_notify_host_group][0], 'localhost') }}"
aodh_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"

View File

@ -95,6 +95,7 @@
_oslomsg_notify_vhost: "{{ aodh_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ aodh_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ aodh_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ aodh_oslomsg_notify_configure }}"
tags:
- always

View File

@ -50,6 +50,7 @@ memcache_security_strategy = ENCRYPT
memcache_secret_key = {{ memcached_encryption_key }}
[oslo_messaging_notifications]
driver = {{ (aodh_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ aodh_oslomsg_notify_transport }}://{% for host in aodh_oslomsg_notify_servers.split(',') %}{{ aodh_oslomsg_notify_userid }}:{{ aodh_oslomsg_notify_password }}@{{ host }}:{{ aodh_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _aodh_oslomsg_notify_vhost_conf }}{% if aodh_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ aodh_oslomsg_notify_ssl_version }}&ssl_ca_file={{ aodh_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[service_credentials]