2015-02-10 18:45:13 +06:00
|
|
|
---
|
|
|
|
|
2015-02-13 18:27:38 +06:00
|
|
|
- name: Replication configuration
|
|
|
|
mongodb_replication:
|
2019-05-15 16:16:11 +02:00
|
|
|
build_indexes: "{{ item.build_indexes|default(omit) }}"
|
2015-02-17 19:18:18 +06:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
2015-02-13 18:27:38 +06:00
|
|
|
login_port: "{{ mongodb_login_port|default(27017) }}"
|
|
|
|
login_user: "{{ mongodb_root_admin_name }}"
|
|
|
|
login_password: "{{ mongodb_root_admin_password }}"
|
2016-04-17 19:43:00 +06:00
|
|
|
replica_set: "{{ mongodb_replication_replset }}"
|
2015-02-13 18:27:38 +06:00
|
|
|
host_name: "{{ item.host_name }}"
|
2015-02-17 19:18:18 +06:00
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
2015-02-13 18:27:38 +06:00
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
2015-12-14 09:17:37 +01:00
|
|
|
hidden: "{{ item.hidden|default(false) }}"
|
|
|
|
priority: "{{ item.priority|default(1.0) }}"
|
2019-05-15 16:16:11 +02:00
|
|
|
votes: "{{ item.votes|default(omit) }}"
|
2019-06-05 15:16:18 +03:00
|
|
|
ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}"
|
2016-04-17 19:43:00 +06:00
|
|
|
when: mongodb_security_authorization == 'enabled'
|
2015-02-17 19:18:18 +06:00
|
|
|
with_items:
|
2016-01-29 14:37:25 +02:00
|
|
|
- "{{ mongodb_replication_params|default([]) }}"
|
2015-02-17 19:18:18 +06:00
|
|
|
|
2019-12-27 13:40:19 +03:00
|
|
|
- name: Replication configuration without auth on master
|
2015-02-17 19:18:18 +06:00
|
|
|
mongodb_replication:
|
2019-05-15 16:16:11 +02:00
|
|
|
build_indexes: "{{ item.build_indexes|default(omit) }}"
|
2015-02-17 19:18:18 +06:00
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
|
|
|
login_port: "{{ mongodb_login_port|default(27017) }}"
|
2016-04-17 19:43:00 +06:00
|
|
|
replica_set: "{{ mongodb_replication_replset }}"
|
2015-02-17 19:18:18 +06:00
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
2015-12-14 09:17:37 +01:00
|
|
|
hidden: "{{ item.hidden|default(false) }}"
|
|
|
|
priority: "{{ item.priority|default(1.0) }}"
|
2019-05-15 16:16:11 +02:00
|
|
|
votes: "{{ item.votes|default(omit) }}"
|
2019-06-05 15:16:18 +03:00
|
|
|
ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}"
|
2019-12-27 13:40:19 +03:00
|
|
|
when: ( mongodb_security_authorization == 'disabled'
|
|
|
|
and mongodb_master is defined and mongodb_master )
|
2015-02-10 18:45:13 +06:00
|
|
|
with_items:
|
2016-01-29 14:37:25 +02:00
|
|
|
- "{{ mongodb_replication_params|default([]) }}"
|
2019-12-27 13:40:19 +03:00
|
|
|
|
|
|
|
- name: Replication configuration without auth on replicas and arbiters
|
|
|
|
mongodb_replication:
|
|
|
|
build_indexes: "{{ item.build_indexes|default(omit) }}"
|
|
|
|
login_host: "{{ mongodb_login_host|default('localhost') }}"
|
|
|
|
login_port: "{{ mongodb_login_port|default(27017) }}"
|
|
|
|
replica_set: "{{ mongodb_replication_replset }}"
|
|
|
|
host_name: "{{ item.host_name }}"
|
|
|
|
host_port: "{{ item.host_port|default(27017) }}"
|
|
|
|
host_type: "{{ item.host_type|default('replica') }}"
|
|
|
|
hidden: "{{ item.hidden|default(false) }}"
|
|
|
|
priority: "{{ item.priority|default(1.0) }}"
|
|
|
|
votes: "{{ item.votes|default(omit) }}"
|
|
|
|
ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}"
|
|
|
|
when: ( mongodb_security_authorization == 'disabled'
|
|
|
|
and ( mongodb_master is not defined or not mongodb_master) )
|
|
|
|
with_items:
|
|
|
|
- "{{ mongodb_replication_params|default([]) }}"
|
|
|
|
|