Handle the hardcoded configuration values

This patch allows to customize the hardcoded configuration values,
as well as introduce new configuration options for aodh services
by configmap template with the specified section:

  aodh:
    server:
      configmap:
        DEFAULT:
          rest_notifier_max_retries: 0
          notifier_topic: alarming
        api:
          user_alarm_quota: 10
          project_alarm_quota: 10
          alarm_max_actions: -1

Change-Id: I49fe8402d99b1cefb58e3449137df255924d3f2b
Related-Prod: PROD-29627
(cherry picked from commit 858785a84cdbfb3add01158d40237af0d41e4b41)
diff --git a/README.rst b/README.rst
index 624468c..04e79ed 100644
--- a/README.rst
+++ b/README.rst
@@ -162,6 +162,22 @@
                 - host: 127.0.1.1
                 - host: 127.0.2.1
 
+Change default options using configmap template settings
+========================================================
+
+.. code-block:: yaml
+
+    aodh:
+      server:
+        configmap:
+          DEFAULT:
+            rest_notifier_max_retries: 0
+            notifier_topic: alarming
+          api:
+            user_alarm_quota: 10
+            project_alarm_quota: 10
+            alarm_max_actions: -1
+
 Development and testing
 =======================
 
diff --git a/aodh/files/ocata/aodh.conf.Debian b/aodh/files/ocata/aodh.conf.Debian
index 712787d..1e58d68 100644
--- a/aodh/files/ocata/aodh.conf.Debian
+++ b/aodh/files/ocata/aodh.conf.Debian
@@ -1762,3 +1762,8 @@
 
 # Message queue service type. (string value)
 #zaqar = messaging
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/aodh/files/pike/aodh.conf.Debian b/aodh/files/pike/aodh.conf.Debian
index cca7e72..f2834a2 100644
--- a/aodh/files/pike/aodh.conf.Debian
+++ b/aodh/files/pike/aodh.conf.Debian
@@ -1800,3 +1800,8 @@
 
 # Message queue service type. (string value)
 #zaqar = messaging
+
+{%- if server.configmap is defined %}
+{%- set _data = server.configmap %}
+{%- include "oslo_templates/files/configmap/configmap.conf" %}
+{%- endif %}
diff --git a/aodh/files/queens/aodh.conf.Debian b/aodh/files/queens/aodh.conf.Debian
index 9514eb2..ce73811 100644
--- a/aodh/files/queens/aodh.conf.Debian
+++ b/aodh/files/queens/aodh.conf.Debian
@@ -280,3 +280,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/tests/pillar/server_cluster.sls b/tests/pillar/server_cluster.sls
index 300094c..8ee6565 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -73,6 +73,14 @@
           fallback:
             - host: 127.0.1.1
             - host: 127.0.2.1
+    configmap:
+      DEFAULT:
+        rest_notifier_max_retries: 0
+        notifier_topic: alarming
+      api:
+        user_alarm_quota: 10
+        project_alarm_quota: 10
+        alarm_max_actions: -1
 apache:
   server:
     enabled: true
diff --git a/tests/pillar/server_single.sls b/tests/pillar/server_single.sls
index a80acbe..50e2745 100644
--- a/tests/pillar/server_single.sls
+++ b/tests/pillar/server_single.sls
@@ -40,6 +40,14 @@
       password: test
     notifications:
       store_events: default
+    configmap:
+      DEFAULT:
+        rest_notifier_max_retries: 0
+        notifier_topic: alarming
+      api:
+        user_alarm_quota: 10
+        project_alarm_quota: 10
+        alarm_max_actions: -1
 apache:
   server:
     enabled: true