|
19 | 19 | with_items:
|
20 | 20 | - "{{ mongodb_replication_params|default([]) }}"
|
21 | 21 |
|
22 |
| -- name: Replication configuration without auth |
| 22 | +- name: Replication configuration without auth on master |
23 | 23 | mongodb_replication:
|
24 | 24 | build_indexes: "{{ item.build_indexes|default(omit) }}"
|
25 | 25 | login_host: "{{ mongodb_login_host|default('localhost') }}"
|
|
32 | 32 | priority: "{{ item.priority|default(1.0) }}"
|
33 | 33 | votes: "{{ item.votes|default(omit) }}"
|
34 | 34 | ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}"
|
35 |
| - when: mongodb_security_authorization == 'disabled' |
| 35 | + when: ( mongodb_security_authorization == 'disabled' |
| 36 | + and mongodb_master is defined and mongodb_master ) |
36 | 37 | with_items:
|
37 | 38 | - "{{ mongodb_replication_params|default([]) }}"
|
| 39 | + |
| 40 | +- name: Replication configuration without auth on replicas and arbiters |
| 41 | + mongodb_replication: |
| 42 | + build_indexes: "{{ item.build_indexes|default(omit) }}" |
| 43 | + login_host: "{{ mongodb_login_host|default('localhost') }}" |
| 44 | + login_port: "{{ mongodb_login_port|default(27017) }}" |
| 45 | + replica_set: "{{ mongodb_replication_replset }}" |
| 46 | + host_name: "{{ item.host_name }}" |
| 47 | + host_port: "{{ item.host_port|default(27017) }}" |
| 48 | + host_type: "{{ item.host_type|default('replica') }}" |
| 49 | + hidden: "{{ item.hidden|default(false) }}" |
| 50 | + priority: "{{ item.priority|default(1.0) }}" |
| 51 | + votes: "{{ item.votes|default(omit) }}" |
| 52 | + ssl: "{{ True if mongodb_net_ssl_mode == 'requireSSL' else False }}" |
| 53 | + when: ( mongodb_security_authorization == 'disabled' |
| 54 | + and ( mongodb_master is not defined or not mongodb_master) ) |
| 55 | + with_items: |
| 56 | + - "{{ mongodb_replication_params|default([]) }}" |
| 57 | + |
0 commit comments