From f6367c6fa2662f05fca5ba4275c4d1d7b844d277 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 3 May 2024 19:28:14 +0200 Subject: [PATCH] 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: Ia29caf1633d5467e870226763088065fde54f12d --- defaults/main.yml | 1 + tasks/main.yml | 1 + templates/designate.conf.j2 | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 59a7dde..3c493d8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -113,6 +113,7 @@ designate_oslomsg_rpc_ssl_ca_file: "{{ oslomsg_rpc_ssl_ca_file | default('') }}" designate_oslomsg_rpc_policies: [] # Notify +designate_oslomsg_notify_configure: "{{ oslomsg_notify_configure | default(designate_ceilometer_enabled) }}" designate_oslomsg_notify_host_group: "{{ oslomsg_notify_host_group | default('rabbitmq_all') }}" designate_oslomsg_notify_setup_host: >- {{ (designate_oslomsg_notify_host_group in groups) | ternary(groups[designate_oslomsg_notify_host_group][0], 'localhost') }} diff --git a/tasks/main.yml b/tasks/main.yml index 66ff291..13e4a2e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -88,6 +88,7 @@ _oslomsg_notify_transport: "{{ designate_oslomsg_notify_transport }}" _oslomsg_configure_notify: "{{ designate_ceilometer_enabled | bool }}" _oslomsg_notify_policies: "{{ designate_oslomsg_notify_policies }}" + _oslomsg_notify_configure: "{{ designate_oslomsg_notify_configure }}" tags: - always diff --git a/templates/designate.conf.j2 b/templates/designate.conf.j2 index 2eae5cd..56c8cff 100644 --- a/templates/designate.conf.j2 +++ b/templates/designate.conf.j2 @@ -36,7 +36,7 @@ rabbit_quorum_delivery_limit = {{ designate_oslomsg_rabbit_quorum_delivery_limit rabbit_quorum_max_memory_bytes = {{ designate_oslomsg_rabbit_quorum_max_memory_bytes }} [oslo_messaging_notifications] -driver = {{ (designate_ceilometer_enabled | bool) | ternary('messagingv2', 'noop') }} +driver = {{ (designate_oslomsg_notify_configure | bool) | ternary('messagingv2', 'noop') }} transport_url = {{ designate_oslomsg_notify_transport }}://{% for host in designate_oslomsg_notify_servers.split(',') %}{{ designate_oslomsg_notify_userid }}:{{ designate_oslomsg_notify_password }}@{{ host }}:{{ designate_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ _designate_oslomsg_notify_vhost_conf }}{% if designate_oslomsg_notify_use_ssl | bool %}?ssl=1&ssl_version={{ designate_oslomsg_notify_ssl_version }}&ssl_ca_file={{ designate_oslomsg_notify_ssl_ca_file }}{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} {% if designate_backend_ssl | bool %}