Handle the hardcoded configuration values
This patch allows to customize the hardcoded configuration values,
as well as introduce new configuration options for panko services
by configmap template with the specified section:
panko:
server:
configmap:
DEFAULT:
api_paste_config: api_paste.ini
api:
default_api_return_limit: 100
storage:
max_retries: 10
Change-Id: I332862254805b2da479a7e9bf2dde06101045b3a
Related-Prod: PROD-29627
(cherry picked from commit 31c752a6eedf41bf4310f7a620acd87b61d0f09b)
diff --git a/README.rst b/README.rst
index a9790fe..ab06b19 100644
--- a/README.rst
+++ b/README.rst
@@ -137,6 +137,22 @@
enabled: true
strategy: ENCRYPT
secret_key: secret
+
+Change default options using configmap template settings
+========================================================
+
+.. code-block:: yaml
+
+ panko:
+ server:
+ configmap:
+ DEFAULT:
+ api_paste_config: api_paste.ini
+ api:
+ default_api_return_limit: 100
+ storage:
+ max_retries: 10
+
More information
================
diff --git a/panko/files/pike/panko.conf.Debian b/panko/files/pike/panko.conf.Debian
index 7420768..df0f780 100644
--- a/panko/files/pike/panko.conf.Debian
+++ b/panko/files/pike/panko.conf.Debian
@@ -581,3 +581,8 @@
# The name of the index in Elasticsearch (string value)
#es_index_name = events
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/panko/files/queens/panko.conf.Debian b/panko/files/queens/panko.conf.Debian
index 76dd0df..c175bd5 100644
--- a/panko/files/queens/panko.conf.Debian
+++ b/panko/files/queens/panko.conf.Debian
@@ -89,3 +89,8 @@
# The name of the index in Elasticsearch (string value)
#es_index_name = events
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/tests/pillar/server_cluster.sls b/tests/pillar/server_cluster.sls
index de177d1..0ba1a7d 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -42,6 +42,13 @@
enabled: true
fluentd:
enabled: false
+ configmap:
+ DEFAULT:
+ api_paste_config: api_paste.ini
+ api:
+ default_api_return_limit: 100
+ storage:
+ max_retries: 10
apache:
server:
enabled: true
diff --git a/tests/pillar/server_single.sls b/tests/pillar/server_single.sls
index ef103f5..d8c4cee 100644
--- a/tests/pillar/server_single.sls
+++ b/tests/pillar/server_single.sls
@@ -35,6 +35,13 @@
enabled: true
fluentd:
enabled: false
+ configmap:
+ DEFAULT:
+ api_paste_config: api_paste.ini
+ api:
+ default_api_return_limit: 100
+ storage:
+ max_retries: 10
apache:
server:
enabled: true