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