enable rabbitmq ha members definition
Change-Id: Ied46352a7ea4ec29092222306bf000b7922241fe
diff --git a/README.rst b/README.rst
index 243234f..1fd8771 100644
--- a/README.rst
+++ b/README.rst
@@ -663,6 +663,31 @@
rpc_port: 9160
....
+RabbitMQ HA hosts
+------------------
+
+.. code-block:: yaml
+
+ opencontrail:
+ config:
+ message_queue:
+ engine: rabbitmq
+ members:
+ - host: 10.0.16.1
+ - host: 10.0.16.2
+ - host: 10.0.16.3
+ port: 5672
+
+.. code-block:: yaml
+
+ database:
+ ....
+ bind:
+ interface: eth0
+ port: 9042
+ rpc_port: 9160
+ ....
+
Usage
=====
diff --git a/opencontrail/files/3.0/contrail-api.conf b/opencontrail/files/3.0/contrail-api.conf
index 86aa8be..807de4c 100644
--- a/opencontrail/files/3.0/contrail-api.conf
+++ b/opencontrail/files/3.0/contrail-api.conf
@@ -16,7 +16,12 @@
#zk_server_ip=10.0.102.31:2181,10.0.102.32:2181,10.0.102.33:2181
zk_server_ip={% for member in config.database.members %}{{ member.host }}:2181{% if not loop.last %},{% endif %}{% endfor %}
redis_server_ip=$__contrail_redis_ip__
+{%- if config.message_queue.members is defined %}
+rabbit_server={{ config.message_queue.members|join(',',attribute='host') }}
+rabbit_ha_mode=True
+{%- else %}
rabbit_server={{ config.message_queue.host }}
+{%- endif %}
rabbit_port={{ config.message_queue.port }}
{%- if config.identity.engine == "keystone" %}
auth=keystone
diff --git a/opencontrail/files/3.0/contrail-device-manager.conf b/opencontrail/files/3.0/contrail-device-manager.conf
index b60e43f..44fcb9b 100644
--- a/opencontrail/files/3.0/contrail-device-manager.conf
+++ b/opencontrail/files/3.0/contrail-device-manager.conf
@@ -1,6 +1,11 @@
{%- from "opencontrail/map.jinja" import config with context %}
[DEFAULTS]
+{%- if config.message_queue.members is defined %}
+rabbit_server={{ config.message_queue.members|join(',',attribute='host') }}
+rabbit_ha_mode=True
+{%- else %}
rabbit_server={{ config.message_queue.host }}
+{%- endif %}
rabbit_port={{ config.message_queue.port }}
api_server_ip={{ config.discovery.host }}
api_server_port=8082
diff --git a/opencontrail/files/3.0/contrail-schema.conf b/opencontrail/files/3.0/contrail-schema.conf
index 23d7b6c..e22fd25 100644
--- a/opencontrail/files/3.0/contrail-schema.conf
+++ b/opencontrail/files/3.0/contrail-schema.conf
@@ -14,7 +14,12 @@
disc_server_port=5998
log_local=1
log_level=SYS_NOTICE
+{%- if config.message_queue.members is defined %}
+rabbit_server={{ config.message_queue.members|join(',',attribute='host') }}
+rabbit_ha_mode=True
+{%- else %}
rabbit_server={{ config.message_queue.host }}
+{%- endif %}
rabbit_port={{ config.message_queue.port }}
[SECURITY]
diff --git a/opencontrail/files/3.0/contrail-svc-monitor.conf b/opencontrail/files/3.0/contrail-svc-monitor.conf
index dc756f0..74d1d34 100644
--- a/opencontrail/files/3.0/contrail-svc-monitor.conf
+++ b/opencontrail/files/3.0/contrail-svc-monitor.conf
@@ -16,7 +16,12 @@
region_name=RegionOne
log_local=1
log_level=SYS_NOTICE
+{%- if config.message_queue.members is defined %}
+rabbit_server={{ config.message_queue.members|join(',',attribute='host') }}
+rabbit_ha_mode=True
+{%- else %}
rabbit_server={{ config.message_queue.host }}
+{%- endif %}
rabbit_port={{ config.message_queue.port }}
[SCHEDULER]