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: I1bffec218f903ea16cbd06e7abf28b8139024df8
This commit is contained in:
Dmitriy Rabotyagov 2024-05-03 20:34:13 +02:00 committed by Dmitriy Rabotyagov
parent fa67e0e01d
commit 3a326c054a
3 changed files with 4 additions and 2 deletions

View File

@ -45,7 +45,7 @@ manila_venv_tag: "{{ venv_tag | default('untagged') }}"
manila_bin: "{{ _manila_bin }}" manila_bin: "{{ _manila_bin }}"
# Enable/Disable Ceilometer # Enable/Disable Ceilometer
manila_ceilometer_enabled: False manila_ceilometer_enabled: "{{ (groups['ceilometer_all'] is defined) and (groups['ceilometer_all'] | length > 0) }}"
manila_storage_availability_zone: nova manila_storage_availability_zone: nova
manila_default_availability_zone: "{{ manila_storage_availability_zone }}" manila_default_availability_zone: "{{ manila_storage_availability_zone }}"
@ -95,6 +95,7 @@ manila_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
manila_oslomsg_rpc_policies: [] manila_oslomsg_rpc_policies: []
# Notify # Notify
manila_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(manila_ceilometer_enabled) }}"
manila_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}" manila_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
manila_oslomsg_notify_setup_host: "{{ (manila_oslomsg_notify_host_group in groups) | ternary(groups[manila_oslomsg_notify_host_group][0], 'localhost') }}" manila_oslomsg_notify_setup_host: "{{ (manila_oslomsg_notify_host_group in groups) | ternary(groups[manila_oslomsg_notify_host_group][0], 'localhost') }}"
manila_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}" manila_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"

View File

@ -117,6 +117,7 @@
_oslomsg_notify_vhost: "{{ manila_oslomsg_notify_vhost }}" _oslomsg_notify_vhost: "{{ manila_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ manila_oslomsg_notify_transport }}" _oslomsg_notify_transport: "{{ manila_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ manila_oslomsg_notify_policies }}" _oslomsg_notify_policies: "{{ manila_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ manila_oslomsg_notify_configure }}"
tags: tags:
- always - always

View File

@ -60,7 +60,7 @@ rabbit_quorum_delivery_limit = {{ manila_oslomsg_rabbit_quorum_delivery_limit }}
rabbit_quorum_max_memory_bytes = {{ manila_oslomsg_rabbit_quorum_max_memory_bytes }} rabbit_quorum_max_memory_bytes = {{ manila_oslomsg_rabbit_quorum_max_memory_bytes }}
[oslo_messaging_notifications] [oslo_messaging_notifications]
driver = {{ (manila_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} driver = {{ (manila_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ manila_oslomsg_notify_transport }}://{% for host in manila_oslomsg_notify_servers.split(',') %}{{ manila_oslomsg_notify_userid }}:{{ manila_oslomsg_notify_password }}@{{ host }}:{{ manila_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _manila_oslomsg_notify_vhost_conf }}{% if manila_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ manila_oslomsg_notify_ssl_version }}&ssl_ca_file={{ manila_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} transport_url = {{ manila_oslomsg_notify_transport }}://{% for host in manila_oslomsg_notify_servers.split(',') %}{{ manila_oslomsg_notify_userid }}:{{ manila_oslomsg_notify_password }}@{{ host }}:{{ manila_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _manila_oslomsg_notify_vhost_conf }}{% if manila_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ manila_oslomsg_notify_ssl_version }}&ssl_ca_file={{ manila_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[oslo_concurrency] [oslo_concurrency]