Merge "Add more parameters to alarm-gen config"
diff --git a/README.rst b/README.rst
index 825b1c0..ba0d7b4 100644
--- a/README.rst
+++ b/README.rst
@@ -129,6 +129,11 @@
           members:
           - host: 127.0.0.1
             port: 9160
+        message_queue:
+          members:
+          - host: 127.0.0.1
+          - host: 127.0.0.1
+          - host: 127.0.0.1
       database:
         version: 2.2
         cassandra:
@@ -286,6 +291,11 @@
             port: 9160
           - host: 127.0.0.1
             port: 9160
+        message_queue:
+          members:
+          - host: 127.0.0.1
+          - host: 127.0.0.1
+          - host: 127.0.0.1
       database:
         version: 2.2
         cassandra:
@@ -518,6 +528,11 @@
             port: 9160
           - host: 127.0.0.1
             port: 9160
+        message_queue:
+          members:
+          - host: 127.0.0.1
+          - host: 127.0.0.1
+          - host: 127.0.0.1
       database:
         version: 2.2
         cassandra:
diff --git a/opencontrail/files/3.0/contrail-alarm-gen.conf b/opencontrail/files/3.0/contrail-alarm-gen.conf
index 1da7577..6ebc244 100644
--- a/opencontrail/files/3.0/contrail-alarm-gen.conf
+++ b/opencontrail/files/3.0/contrail-alarm-gen.conf
@@ -1,4 +1,4 @@
-{%- from "opencontrail/map.jinja" import collector with context %}
+{%- from "opencontrail/map.jinja" import collector,common with context %}
 [DEFAULTS]
 host_ip = {{ collector.bind.address }}
 #collectors = 127.0.0.1:8086
@@ -12,10 +12,31 @@
 log_file = /var/log/contrail/contrail-alarm-gen.log
 kafka_broker_list = {% for member in collector.database.members %}{{ member.host }}:9092 {% endfor %}
 zk_list = {% for member in collector.database.members %}{{ member.host }}:2181{% if not loop.last %},{% endif %}{% endfor %}
+{%- if collector.message_queue.members is defined %}
+rabbitmq_server_list={{ collector.message_queue.members|join(',',attribute='host') }}
+rabbitmq_ha_mode=True
+{%- else %}
+rabbitmq_server_list={{ collector.message_queue.host }}
+{%- endif %}
+rabbitmq_port={{ collector.get('message_queue', {}).get('port', 5672) }}
 
 [DISCOVERY]
 disc_server_ip = {{ collector.discovery.host }}
 disc_server_port = 5998
 
+[API_SERVER]
+api_server_list={{ collector.discovery.host }}:8082
+api_server_use_ssl=False
+
+{%- if common.identity.engine == "keystone" and not common.get('k8s_enabled', False) %}
+[KEYSTONE]
+auth_host={{ common.identity.host }}
+auth_protocol=http
+auth_port={{ common.identity.port }}
+admin_user={{ common.identity.get('user', "admin") }}
+admin_password={{ common.identity.password }}
+admin_tenant_name={{ common.identity.get('tenant', "admin") }}
+{%- endif %}
+
 [REDIS]
 #redis_server_port=6379
diff --git a/tests/pillar/analytics3.sls b/tests/pillar/analytics3.sls
index 1a5e861..2afcd1c 100644
--- a/tests/pillar/analytics3.sls
+++ b/tests/pillar/analytics3.sls
@@ -32,6 +32,12 @@
         port: 9160
       - host: 127.0.0.1
         port: 9160
+    message_queue:
+      host: 127.0.0.1
+      members:
+      - host: 127.0.0.1
+      - host: 127.0.0.1
+      - host: 127.0.0.1
   database:
     version: 3.0
     cassandra:
diff --git a/tests/pillar/cluster3.sls b/tests/pillar/cluster3.sls
index 1f97957..54c9d41 100644
--- a/tests/pillar/cluster3.sls
+++ b/tests/pillar/cluster3.sls
@@ -104,6 +104,12 @@
         port: 9160
       - host: 127.0.0.1
         port: 9160
+    message_queue:
+      host: 127.0.0.1
+      members:
+      - host: 127.0.0.1
+      - host: 127.0.0.1
+      - host: 127.0.0.1
   database:
     version: 3.0
     cassandra:
diff --git a/tests/pillar/single3.sls b/tests/pillar/single3.sls
index 859caf7..43f6dd6 100644
--- a/tests/pillar/single3.sls
+++ b/tests/pillar/single3.sls
@@ -80,6 +80,12 @@
       members:
       - host: 127.0.0.1
         port: 9160
+    message_queue:
+      host: 127.0.0.1
+      members:
+      - host: 127.0.0.1
+      - host: 127.0.0.1
+      - host: 127.0.0.1
   database:
     version: 3.0
     cassandra: