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: I061653c3976458c0161915b7273f1ee2c575df13
This commit is contained in:
Dmitriy Rabotyagov 2024-04-26 19:16:36 +02:00 committed by Dmitriy Rabotyagov
parent 29bf7db198
commit 3a8a9da7b9
4 changed files with 8 additions and 3 deletions

View File

@ -145,6 +145,7 @@ trove_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2')
trove_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
trove_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(trove_ceilometer_enabled) }}"
trove_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
trove_oslomsg_notify_setup_host: "{{ (trove_oslomsg_notify_host_group in groups) | ternary(groups[trove_oslomsg_notify_host_group][0], 'localhost') }}"
trove_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"
@ -213,6 +214,7 @@ trove_guest_oslomsg_rpc_vhost:
- name: trove
state: "{{ trove_guest_oslomsg_rabbit_quorum_queues | ternary('present', 'absent') }}"
trove_guest_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(trove_ceilometer_enabled) }}"
trove_guest_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
trove_guest_oslomsg_notify_servers: >-
{{

View File

@ -84,6 +84,7 @@
_oslomsg_notify_vhost: "{{ trove_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ trove_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ trove_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ trove_oslomsg_notify_configure }}"
tags:
- always
@ -96,7 +97,8 @@
- trove-agent-config
when:
- _trove_is_first_play_host
- (trove_oslomsg_rpc_host_group != trove_guest_rpc_host_group) or (trove_oslomsg_notify_host_group != trove_guest_notify_host_group)
- (trove_oslomsg_rpc_host_group != trove_guest_rpc_host_group) or
(trove_oslomsg_notify_host_group != trove_guest_notify_host_group and trove_guest_oslomsg_notify_configure)
vars:
_oslomsg_rpc_setup_host: "{{ trove_guest_rpc_host_group }}"
_oslomsg_rpc_userid: "{{ trove_guest_oslomsg_rpc_userid }}"
@ -110,6 +112,7 @@
_oslomsg_notify_vhost: "{{ trove_guest_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ trove_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ trove_guest_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ trove_guest_oslomsg_notify_configure }}"
tags:
- always

View File

@ -37,7 +37,7 @@ rabbit_quorum_max_memory_bytes = {{ trove_oslomsg_rabbit_quorum_max_memory_bytes
[oslo_messaging_notifications]
{% set notification_topics = [] %}
{% if trove_ceilometer_enabled %}
{% if trove_guest_oslomsg_notify_configure %}
{% set _ = notification_topics.append('notifications') %}
{% endif %}
{% if trove_designate_enabled %}

View File

@ -132,7 +132,7 @@ rabbit_quorum_max_memory_bytes = {{ trove_oslomsg_rabbit_quorum_max_memory_bytes
[oslo_messaging_notifications]
{% set notification_topics = [] %}
{% if trove_ceilometer_enabled %}
{% if trove_oslomsg_notify_configure %}
{% set _ = notification_topics.append('notifications') %}
{% endif %}
{% if trove_designate_enabled %}