summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/templates/replica.js
blob: d19db50d0d273be0d27d8b2e0f7535dd25cc6729 (plain)
1
2
3
4
5
6
7
8
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 }}},
{% endfor %}
]
};
rs.initiate(config);