Commit 535c541d by Feanil Patel

Add a new var for configuring a replica set.

parent 6cdbdaba
......@@ -26,6 +26,9 @@ mongodb_debian_pkgs:
- "mongodb-org-tools={{ mongo_version }}"
mongo_configure_replica_set: true
# Vars Meant to be overridden
MONGO_ADMIN_USER: 'admin'
MONGO_ADMIN_PASSWORD: 'password'
......
......@@ -280,7 +280,7 @@
rs_config: "{{ MONGO_RS_CONFIG }}"
run_once: true
register: replset_status
when: initialize_replica_set
when: mongo_configure_replica_set
tags:
- "manage"
- "manage:db"
......@@ -298,7 +298,7 @@
password: "{{ MONGO_ADMIN_PASSWORD }}"
register: status
until: status.status is defined and 'PRIMARY' in status.status.members|map(attribute='stateStr')|list
when: initialize_replica_set
when: mongo_configure_replica_set
retries: 5
delay: 2
run_once: true
......@@ -320,7 +320,7 @@
replica_set: "{{ MONGO_REPL_SET }}"
with_items: "{{ MONGO_USERS }}"
run_once: true
when: initialize_replica_set
when: mongo_configure_replica_set
tags:
- "manage"
- "manage:db"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment