From 1483fcbc2802e4d6364138e19516b24114abfadf Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 13 May 2022 11:19:21 +0200 Subject: [PATCH] Add variables to manage redis url To provide more convenience in configuring redis as Gnocchi driver, we add 2 variables that can be used to control URL to Redis when it's used for storage or incoming data. Related-Bug: #1955676 Change-Id: Iba5186df3656c116cba48c3be0e39e87ddcb727f --- defaults/main.yml | 2 ++ .../notes/gnocchi_redis_driver-ea6bcb123755094b.yaml | 9 +++++++++ templates/gnocchi.conf.j2 | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/gnocchi_redis_driver-ea6bcb123755094b.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 93d70c7..1aeed90 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -80,6 +80,7 @@ gnocchi_galera_port: "{{ galera_port | default('3306') }}" gnocchi_storage_driver: file gnocchi_storage_file_basepath: "{{ gnocchi_system_user_home }}" gnocchi_storage_swift_container_prefix: "gnocchi" +gnocchi_storage_redis_url: "redis://localhost:6379/" gnocchi_coordination_url: "mysql://{{ gnocchi_galera_user }}:{{ gnocchi_container_mysql_password }}@{{ gnocchi_galera_address }}/{{ gnocchi_galera_database }}?charset=utf8&timeout=5{% if gnocchi_galera_use_ssl | bool %}&ssl_ca={{ gnocchi_galera_ssl_ca_cert }}{% endif %}" @@ -88,6 +89,7 @@ gnocchi_coordination_url: "mysql://{{ gnocchi_galera_user }}:{{ gnocchi_containe gnocchi_incoming_driver: "{{ gnocchi_storage_driver }}" gnocchi_incoming_file_basepath: "{{ gnocchi_storage_file_basepath }}" gnocchi_incoming_swift_container_prefix: "{{ gnocchi_storage_swift_container_prefix }}" +gnocchi_incoming_redis_url: "{{ gnocchi_storage_redis_url }}" #: Default Ceph parameters gnocchi_ceph_pool: "metrics" diff --git a/releasenotes/notes/gnocchi_redis_driver-ea6bcb123755094b.yaml b/releasenotes/notes/gnocchi_redis_driver-ea6bcb123755094b.yaml new file mode 100644 index 0000000..a982456 --- /dev/null +++ b/releasenotes/notes/gnocchi_redis_driver-ea6bcb123755094b.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Variables ``gnocchi_storage_redis_url`` and ``gnocchi_incoming_redis_url`` + were added to manage redis connection if it's picked as an storage/incoming + driver. + Default value is redis://localhost:6379/ + Please mention, that OpenStack-Ansible does not provide isntallation of + Redis as of today. diff --git a/templates/gnocchi.conf.j2 b/templates/gnocchi.conf.j2 index c34108e..00e5388 100644 --- a/templates/gnocchi.conf.j2 +++ b/templates/gnocchi.conf.j2 @@ -76,6 +76,9 @@ ceph_pool = {{ gnocchi_ceph_pool }} # Ceph username (ie: admin without "client." prefix). ceph_username = {{ gnocchi_ceph_username }} {% endif %} +{% if gnocchi_storage_driver == 'redis' %} +redis_url = {{ gnocchi_storage_redis_url }} +{% endif %} {% if gnocchi_storage_driver != gnocchi_incoming_driver %} [incoming] @@ -112,6 +115,9 @@ ceph_pool = {{ gnocchi_ceph_incoming_pool }} # Ceph username (ie: admin without "client." prefix). ceph_username = {{ gnocchi_ceph_incoming_username }} {% endif %} +{% if gnocchi_incoming_driver == 'redis' %} +redis_url = {{ gnocchi_incoming_redis_url }} +{% endif %} {% endif %} [metricd]