summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/templates
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/database/templates')
-rw-r--r--deploy/adapters/ansible/roles/database/templates/replica.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/deploy/adapters/ansible/roles/database/templates/replica.js b/deploy/adapters/ansible/roles/database/templates/replica.js
index dd5fc575..7e7072ff 100644
--- a/deploy/adapters/ansible/roles/database/templates/replica.js
+++ b/deploy/adapters/ansible/roles/database/templates/replica.js
@@ -1,8 +1,8 @@
config = { _id:"compass", members:[
-{% for host in haproxy_hosts.values() %}
+{% for hostname, host in haproxy_hosts.items() %}
{% set pair = '%s:27017' % host %}
- {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[inventory_hostname] + 1 }}},
-{% endfor %}
-]
+ {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[hostname] + 1 }}},
+ {% endfor %}
+ ]
};
rs.initiate(config);