Commit 535c541d by Feanil Patel

Add a new var for configuring a replica set.

parent 6cdbdaba
...@@ -26,6 +26,9 @@ mongodb_debian_pkgs: ...@@ -26,6 +26,9 @@ mongodb_debian_pkgs:
- "mongodb-org-tools={{ mongo_version }}" - "mongodb-org-tools={{ mongo_version }}"
mongo_configure_replica_set: true
# Vars Meant to be overridden # Vars Meant to be overridden
MONGO_ADMIN_USER: 'admin' MONGO_ADMIN_USER: 'admin'
MONGO_ADMIN_PASSWORD: 'password' MONGO_ADMIN_PASSWORD: 'password'
......
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
rs_config: "{{ MONGO_RS_CONFIG }}" rs_config: "{{ MONGO_RS_CONFIG }}"
run_once: true run_once: true
register: replset_status register: replset_status
when: initialize_replica_set when: mongo_configure_replica_set
tags: tags:
- "manage" - "manage"
- "manage:db" - "manage:db"
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
password: "{{ MONGO_ADMIN_PASSWORD }}" password: "{{ MONGO_ADMIN_PASSWORD }}"
register: status register: status
until: status.status is defined and 'PRIMARY' in status.status.members|map(attribute='stateStr')|list 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 retries: 5
delay: 2 delay: 2
run_once: true run_once: true
...@@ -320,7 +320,7 @@ ...@@ -320,7 +320,7 @@
replica_set: "{{ MONGO_REPL_SET }}" replica_set: "{{ MONGO_REPL_SET }}"
with_items: "{{ MONGO_USERS }}" with_items: "{{ MONGO_USERS }}"
run_once: true run_once: true
when: initialize_replica_set when: mongo_configure_replica_set
tags: tags:
- "manage" - "manage"
- "manage:db" - "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