Add variable to globally control notifications enablement and disable RPC

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.

This change also disables RPC communication for Glance since there's
no signs of RPC usage in Glance code. RabbitMQ seems to be used solely
for notifications

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/914144
Change-Id: I854374788ed92efe0164c29414978a1d14b83410
This commit is contained in:
Dmitriy Rabotyagov 2024-04-23 19:13:13 +02:00 committed by Dmitriy Rabotyagov
parent 2c9df6e665
commit 5772b128a5
3 changed files with 7 additions and 1 deletions

View File

@ -107,6 +107,7 @@ glance_enable_v2_api: True
## Oslo Messaging Info
# RPC
glance_oslomsg_rpc_configure: False
glance_oslomsg_rpc_host_group: "{{ oslomsg_rpc_host_group | default('rabbitmq_all') }}"
glance_oslomsg_rpc_setup_host: "{{ (glance_oslomsg_rpc_host_group in groups) | ternary(groups[glance_oslomsg_rpc_host_group][0], 'localhost') }}"
glance_oslomsg_rpc_transport: "{{ oslomsg_rpc_transport | default('rabbit') }}"
@ -126,6 +127,7 @@ glance_oslomsg_rpc_ssl_version: "{{ oslomsg_rpc_ssl_version | default('TLSv1_2')
glance_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}"
# Notify
glance_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(glance_ceilometer_enabled) }}"
glance_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}"
glance_oslomsg_notify_setup_host: "{{ (glance_oslomsg_notify_host_group in groups) | ternary(groups[glance_oslomsg_notify_host_group][0], 'localhost') }}"
glance_oslomsg_notify_transport: "{{ oslomsg_notify_transport | default('rabbit') }}"

View File

@ -81,12 +81,14 @@
_oslomsg_rpc_vhost: "{{ glance_oslomsg_rpc_vhost }}"
_oslomsg_rpc_transport: "{{ glance_oslomsg_rpc_transport }}"
_oslomsg_rpc_policies: "{{ glance_oslomsg_rpc_policies }}"
_oslomsg_rpc_configure: "{{ glance_oslomsg_rpc_configure }}"
_oslomsg_notify_setup_host: "{{ glance_oslomsg_notify_setup_host }}"
_oslomsg_notify_userid: "{{ glance_oslomsg_notify_userid }}"
_oslomsg_notify_password: "{{ glance_oslomsg_notify_password }}"
_oslomsg_notify_vhost: "{{ glance_oslomsg_notify_vhost }}"
_oslomsg_notify_transport: "{{ glance_oslomsg_notify_transport }}"
_oslomsg_notify_policies: "{{ glance_oslomsg_notify_policies }}"
_oslomsg_notify_configure: "{{ glance_oslomsg_notify_configure }}"
tags:
- always

View File

@ -16,7 +16,9 @@ worker_self_reference_url = {{ (glance_backend_ssl | ternary('https', 'http')) ~
enable_v2_api = {{ glance_enable_v2_api | bool }}
{% if glance_oslomsg_rpc_configure %}
transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslomsg_rpc_servers.split(',') %}{{ glance_oslomsg_rpc_userid }}:{{ glance_oslomsg_rpc_password }}@{{ host }}:{{ glance_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ _glance_oslomsg_rpc_vhost_conf }}{% if glance_oslomsg_rpc_use_ssl | bool %}?ssl=1&ssl_version={{ glance_oslomsg_rpc_ssl_version }}&ssl_ca_file={{ glance_oslomsg_rpc_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
{% endif %}
scrub_time = 43200
@ -83,7 +85,7 @@ rabbit_quorum_max_memory_bytes = {{ glance_oslomsg_rabbit_quorum_max_memory_byte
[oslo_messaging_notifications]
topics = notifications
driver = {{ (glance_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }}
driver = {{ (glance_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }}
transport_url = {{ glance_oslomsg_notify_transport }}://{% for host in glance_oslomsg_notify_servers.split(',') %}{{ glance_oslomsg_notify_userid }}:{{ glance_oslomsg_notify_password }}@{{ host }}:{{ glance_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _glance_oslomsg_notify_vhost_conf }}{% if glance_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ glance_oslomsg_notify_ssl_version }}&ssl_ca_file={{ glance_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %}
[paste_deploy]