From: carey.xu Date: Mon, 11 Jan 2016 07:47:14 +0000 (+0800) Subject: bugfix: mongodb's priority should consistent with keepalived for failover X-Git-Tag: brahmaputra.1.0~67 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F6369%2F3;p=compass4nfv.git bugfix: mongodb's priority should consistent with keepalived for failover JIRA: COMPASS-260 Change-Id: I29e6e21e514e6dab5643e5558c81b851a4442e54 Signed-off-by: carey.xu (cherry picked from commit da39c5ca863f133f6bbf978dce10b9d21b6b5399) --- diff --git a/deploy/adapters/ansible/roles/database/templates/replica.js b/deploy/adapters/ansible/roles/database/templates/replica.js index d19db50d..dd5fc575 100644 --- a/deploy/adapters/ansible/roles/database/templates/replica.js +++ b/deploy/adapters/ansible/roles/database/templates/replica.js @@ -1,7 +1,7 @@ config = { _id:"compass", members:[ {% for host in haproxy_hosts.values() %} {% set pair = '%s:27017' % host %} - {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ haproxy_hosts|length - loop.index0 }}}, + {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[inventory_hostname] + 1 }}}, {% endfor %} ] };