2015-06-22 08:59:25 +00:00
|
|
|
---
|
2016-04-17 13:43:00 +00:00
|
|
|
- name: Replication configuration | 1st Pt.
|
2015-06-22 08:59:25 +00:00
|
|
|
mongodb_replication:
|
2019-05-15 14:16:11 +00:00
|
|
|
build_indexes: "{{ item.build_indexes|default(omit) }}"
|
2015-06-25 11:33:19 +00:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
2016-04-17 13:43:00 +00:00
|
|
|
login_port: "{{ mongodb_net_port|default(27017) }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
login_user: "{{ mongodb_root_admin_name }}"
|
|
|
|
login_password: "{{ mongodb_root_admin_password }}"
|
2016-04-17 13:43:00 +00:00
|
|
|
replica_set: "{{ mongodb_replication_replset }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
2015-12-14 08:17:37 +00:00
|
|
|
hidden: "{{ item.hidden|default(false) }}"
|
|
|
|
priority: "{{ item.priority|default(1.0) }}"
|
2019-05-15 14:16:11 +00:00
|
|
|
votes: "{{ item.votes|default(omit) }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
with_items:
|
2016-01-29 12:37:25 +00:00
|
|
|
- "{{ mongodb_replication_params|default([]) }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
register: mongodb_replica_init
|
|
|
|
ignore_errors: true
|
|
|
|
|
2018-02-20 18:23:43 +00:00
|
|
|
- include: auth_initialization.yml
|
2015-06-22 08:59:25 +00:00
|
|
|
when: mongodb_replica_init|failed
|
|
|
|
|
2016-04-17 13:43:00 +00:00
|
|
|
- name: Replication configuration | 2nd Pt
|
2015-06-22 08:59:25 +00:00
|
|
|
mongodb_replication:
|
2019-05-15 14:16:11 +00:00
|
|
|
build_indexes: "{{ item.build_indexes|default(omit) }}"
|
2015-06-25 11:33:19 +00:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
2016-04-17 13:43:00 +00:00
|
|
|
login_port: "{{ mongodb_net_port|default(27017) }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
login_user: "{{ mongodb_root_admin_name }}"
|
|
|
|
login_password: "{{ mongodb_root_admin_password }}"
|
2016-04-17 13:43:00 +00:00
|
|
|
replica_set: "{{ mongodb_replication_replset }}"
|
2015-06-22 08:59:25 +00:00
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
2015-12-14 08:17:37 +00:00
|
|
|
hidden: "{{ item.hidden|default(false) }}"
|
|
|
|
priority: "{{ item.priority|default(1.0) }}"
|
2019-05-15 14:16:11 +00:00
|
|
|
votes: "{{ item.votes|default(omit) }}"
|
2016-04-17 13:43:00 +00:00
|
|
|
when: mongodb_replica_init|failed
|
2015-06-22 08:59:25 +00:00
|
|
|
with_items:
|
2016-01-29 12:37:25 +00:00
|
|
|
- "{{ mongodb_replication_params|default([]) }}"
|