Handle the hardcoded configuration values

This patch allows to customize the hardcoded configuration values,
as well as introduce new configuration options for heat services
by configmap template

Change-Id: I93056ddf64c737abfcc40151105af129f8b2c2d6
Related-Prod: PROD-29040
diff --git a/README.rst b/README.rst
index 32fa6eb..19a6229 100644
--- a/README.rst
+++ b/README.rst
@@ -293,6 +293,28 @@
             enabled: true
             strategy: ENCRYPT
             secret_key: secret
+
+Heat configmap setup:
+---------------
+
+.. code-block:: yaml
+
+  heat:
+    server:
+      configmap:
+        DEFAULT:
+          debug: true
+        database:
+          idle_timeout: 300
+          min_pool_size: 5
+          max_pool_size: 50
+        oslo_messaging_rabbit:
+          pool_max_size: 30
+          pool_max_overflow: 30
+          pool_recycle: 600
+
+.. code-block::
+
 Upgrades
 ========
 
diff --git a/heat/files/ocata/heat.conf.Debian b/heat/files/ocata/heat.conf.Debian
index 4d276f8..9a24525 100644
--- a/heat/files/ocata/heat.conf.Debian
+++ b/heat/files/ocata/heat.conf.Debian
@@ -2815,3 +2815,8 @@
 # until cinder-backup service becomes discoverable, see LP#1334856. (boolean
 # value)
 #backups_enabled = true
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/heat/files/pike/heat.conf.Debian b/heat/files/pike/heat.conf.Debian
index cbac037..a0e7555 100644
--- a/heat/files/pike/heat.conf.Debian
+++ b/heat/files/pike/heat.conf.Debian
@@ -2835,3 +2835,8 @@
 # until cinder-backup service becomes discoverable, see LP#1334856. (boolean
 # value)
 #backups_enabled = true
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/heat/files/queens/heat.conf.Debian b/heat/files/queens/heat.conf.Debian
index ec84f36..f28c898 100644
--- a/heat/files/queens/heat.conf.Debian
+++ b/heat/files/queens/heat.conf.Debian
@@ -1350,3 +1350,8 @@
 {%- do _data.update(server.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/heat/files/rocky/heat.conf.Debian b/heat/files/rocky/heat.conf.Debian
index 548291e..f6a7673 100644
--- a/heat/files/rocky/heat.conf.Debian
+++ b/heat/files/rocky/heat.conf.Debian
@@ -1420,3 +1420,8 @@
 {%- do _data.update(server.cache) %}
 {%- include "oslo_templates/files/" ~ server.version ~ "/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 d9d675f..946bc3b 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -86,3 +86,14 @@
         enabled: true
         strategy: ENCRYPT
         secret_key: secret
+    configmap:
+      DEFAULT:
+        debug: true
+      database:
+        idle_timeout: 300
+        min_pool_size: 5
+        max_pool_size: 50
+      oslo_messaging_rabbit:
+        pool_max_size: 30
+        pool_max_overflow: 30
+        pool_recycle: 600