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/mongodb.conf3
-rw-r--r--deploy/adapters/ansible/roles/database/templates/replica.js8
2 files changed, 10 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/roles/database/templates/mongodb.conf b/deploy/adapters/ansible/roles/database/templates/mongodb.conf
index 68b84d7a..18306154 100644
--- a/deploy/adapters/ansible/roles/database/templates/mongodb.conf
+++ b/deploy/adapters/ansible/roles/database/templates/mongodb.conf
@@ -1,4 +1,5 @@
# mongodb.conf
-bind_ip = {{ internal_vip.ip }}
+bind_ip = 0.0.0.0
+replSet = compass
port = 27017
smallfiles = true
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);