summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/database/templates/replica.js
blob: 7e7072ffb01931fd9c54a300d2bd2285f5ab801d (plain)
1
2
3
4
5
6
7
8
config = { _id:"compass", members:[
{% for hostname, host in haproxy_hosts.items() %}
{% set pair = '%s:27017' % host %}
    {_id:{{ loop.index0 }},host:"{{ pair }}",priority:{{ host_index[hostname] + 1 }}},
    {% endfor %}
    ]
};
rs.initiate(config);