Handle the hardcoded configuration values
This patch allows to customize the hardcoded configuration values,
as well as introduce new configuration options for gnocchi services
by configmap template with the specified section:
gnocchi:
common:
configmap:
DEFAULT:
debug: false
verbose: true
server:
configmap:
DEFAULT:
debug: false
verbose: true
api:
paste_config: api-paste.ini
max_limit: 1000
statsd:
configmap:
DEFAULT:
debug: false
verbose: true
statsd:
host: 0.0.0.0
port: 8125
Change-Id: If2bfbe272020157c87766f4277b6da5b0577a4b7
Related-Prod: PROD-29627
diff --git a/README.rst b/README.rst
index 8e8f36e..8b27119 100644
--- a/README.rst
+++ b/README.rst
@@ -391,6 +391,34 @@
- host: 127.0.1.1
- host: 127.0.2.1
+Change default options using configmap template settings
+========================================================
+
+.. code-block:: yaml
+
+ gnocchi:
+ common:
+ configmap:
+ DEFAULT:
+ debug: false
+ verbose: true
+ server:
+ configmap:
+ DEFAULT:
+ debug: false
+ verbose: true
+ api:
+ paste_config: api-paste.ini
+ max_limit: 1000
+ statsd:
+ configmap:
+ DEFAULT:
+ debug: false
+ verbose: true
+ statsd:
+ host: 0.0.0.0
+ port: 8125
+
More Information
================
diff --git a/gnocchi/files/4.0/gnocchi.conf b/gnocchi/files/4.0/gnocchi.conf
index 1aa8b77..d92b37e 100644
--- a/gnocchi/files/4.0/gnocchi.conf
+++ b/gnocchi/files/4.0/gnocchi.conf
@@ -211,3 +211,8 @@
coordination_url = {{ cfg.coordination_backend.url }}
{%- endif %}
{%- endif %}
+
+{%- if cfg.configmap is defined %}
+{%- set _data = cfg.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/gnocchi/files/4.2/gnocchi.conf b/gnocchi/files/4.2/gnocchi.conf
index 7f59338..9035bc5 100644
--- a/gnocchi/files/4.2/gnocchi.conf
+++ b/gnocchi/files/4.2/gnocchi.conf
@@ -267,3 +267,8 @@
[cache]
{%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
{%- endif %}
+
+{%- if cfg.configmap is defined %}
+{%- set _data = cfg.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/gnocchi/files/4.3/gnocchi.conf b/gnocchi/files/4.3/gnocchi.conf
index 7b838fd..59868f4 100644
--- a/gnocchi/files/4.3/gnocchi.conf
+++ b/gnocchi/files/4.3/gnocchi.conf
@@ -268,3 +268,8 @@
[cache]
{%- include "oslo_templates/files/rocky/oslo/_cache.conf" %}
{%- endif %}
+
+{%- if cfg.configmap is defined %}
+{%- set _data = cfg.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}