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
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 f5e7a82..0ea0b6f 100644
--- a/panko/files/queens/panko.conf.Debian
+++ b/panko/files/queens/panko.conf.Debian
@@ -95,3 +95,8 @@
 [cache]
 {%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
 {%- endif %}
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/panko/files/rocky/panko.conf.Debian b/panko/files/rocky/panko.conf.Debian
index 30471b1..18ca80a 100644
--- a/panko/files/rocky/panko.conf.Debian
+++ b/panko/files/rocky/panko.conf.Debian
@@ -95,3 +95,8 @@
 [cache]
 {%- include "oslo_templates/files/rocky/oslo/_cache.conf" %}
 {%- endif %}
+
+{%- 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 521a30b..7a6cee2 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -46,6 +46,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