From 93c1d232c539239f997feb9ab9fc76d9b248d1a9 Mon Sep 17 00:00:00 2001 From: Hemanth Nakkina Date: Fri, 25 Aug 2023 16:32:20 +0530 Subject: [PATCH] Enable notifications Currently the notifications are not sent by the service. Add configuration parameter enable-telemetry-notifications to toggle notifications. Set notification driver to messagingv2 when the parameter is set to True. Change-Id: I8299a2263b1e139d8cc6ae902ce5b45ec934836d --- charms/cinder-ceph-k8s/config.yaml | 4 ++++ charms/cinder-ceph-k8s/src/templates/cinder.conf.j2 | 2 ++ .../src/templates/parts/section-oslo-notifications | 4 ++++ 3 files changed, 10 insertions(+) create mode 100644 charms/cinder-ceph-k8s/src/templates/parts/section-oslo-notifications diff --git a/charms/cinder-ceph-k8s/config.yaml b/charms/cinder-ceph-k8s/config.yaml index 8b2eb96e..027c8ceb 100644 --- a/charms/cinder-ceph-k8s/config.yaml +++ b/charms/cinder-ceph-k8s/config.yaml @@ -246,3 +246,7 @@ options: type: string default: description: RabbitMQ virtual host to request access on rabbitmq-server. + enable-telemetry-notifications: + type: boolean + default: False + description: Enable notifications to send to telemetry. diff --git a/charms/cinder-ceph-k8s/src/templates/cinder.conf.j2 b/charms/cinder-ceph-k8s/src/templates/cinder.conf.j2 index 00aebfe2..84517fb4 100644 --- a/charms/cinder-ceph-k8s/src/templates/cinder.conf.j2 +++ b/charms/cinder-ceph-k8s/src/templates/cinder.conf.j2 @@ -24,6 +24,8 @@ connection = {{ database.connection }} {% endif -%} connection_recycle_time = 200 +{% include "parts/section-oslo-notifications" %} + [{{ cinder_ceph.backend_name }}] volume_driver = cinder.volume.drivers.rbd.RBDDriver rbd_exclusive_cinder_pool = True diff --git a/charms/cinder-ceph-k8s/src/templates/parts/section-oslo-notifications b/charms/cinder-ceph-k8s/src/templates/parts/section-oslo-notifications new file mode 100644 index 00000000..ce559feb --- /dev/null +++ b/charms/cinder-ceph-k8s/src/templates/parts/section-oslo-notifications @@ -0,0 +1,4 @@ +{% if options.enable_telemetry_notifications -%} +[oslo_messaging_notifications] +driver = messagingv2 +{%- endif %}