|
21 | 21 | - name: Include replication and auth configuration
|
22 | 22 | include: replication_init_auth.yml
|
23 | 23 | when: ( mongodb_replication_replset
|
24 |
| - and mongodb_replication_replset != '' |
25 | 24 | and mongodb_security_authorization == 'enabled'
|
26 | 25 | and mongodb_master is defined and mongodb_master )
|
27 | 26 | tags: [mongodb]
|
28 | 27 |
|
29 | 28 | - name: Include replication configuration
|
30 | 29 | include: replication.yml
|
31 |
| - when: mongodb_replication_replset and mongodb_replication_replset != '' |
| 30 | + when: mongodb_replication_replset |
32 | 31 | tags: [mongodb]
|
33 | 32 |
|
34 | 33 | - name: Check where admin user already exists
|
|
40 | 39 | check_mode: no
|
41 | 40 | ignore_errors: true
|
42 | 41 | when: ( mongodb_security_authorization == 'enabled'
|
43 |
| - and (not mongodb_replication_replset |
44 |
| - or mongodb_replication_replset == '') ) |
| 42 | + and not mongodb_replication_replset ) |
45 | 43 | no_log: true
|
46 | 44 | tags: [mongodb]
|
47 | 45 |
|
48 | 46 | - name: Include authorization configuration
|
49 | 47 | include: auth_initialization.yml
|
50 | 48 | when: ( mongodb_security_authorization == 'enabled'
|
51 |
| - and (not mongodb_replication_replset |
52 |
| - or mongodb_replication_replset == '') |
| 49 | + and not mongodb_replication_replset |
53 | 50 | and mongodb_user_admin_check.rc != 0 )
|
54 | 51 | tags: [mongodb]
|
55 | 52 |
|
|
67 | 64 | with_items:
|
68 | 65 | - "{{ mongodb_users | default([]) }}"
|
69 | 66 | when: ( mongodb_replication_replset
|
70 |
| - and mongodb_replication_replset != '' |
71 | 67 | and mongodb_security_authorization == 'enabled'
|
72 | 68 | and mongodb_master is defined and mongodb_master )
|
73 | 69 | no_log: true
|
|
86 | 82 | with_items:
|
87 | 83 | - "{{ mongodb_users | default([]) }}"
|
88 | 84 | when: ( mongodb_security_authorization == 'enabled'
|
89 |
| - and (not mongodb_replication_replset |
90 |
| - or mongodb_replication_replset == '') ) |
| 85 | + and not mongodb_replication_replset ) |
91 | 86 | no_log: true
|
92 | 87 | tags: [mongodb]
|
93 | 88 |
|
|
107 | 102 | with_items:
|
108 | 103 | - "{{ mongodb_oplog_users | default([]) }}"
|
109 | 104 | when: ( mongodb_replication_replset
|
110 |
| - and mongodb_replication_replset != '' |
111 | 105 | and mongodb_security_authorization == 'enabled'
|
112 | 106 | and mongodb_master is defined and mongodb_master )
|
113 | 107 | no_log: false
|
114 | 108 | tags: [mongodb]
|
115 | 109 |
|
116 | 110 | - name: Include MMS Agent configuration
|
117 | 111 | include: mms-agent.yml
|
118 |
| - when: mongodb_mms_api_key != "" |
| 112 | + when: mongodb_mms_api_key |
119 | 113 | tags: [mongodb]
|
0 commit comments