This repository was archived by the owner on May 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
+ - name : Ensure users and passwords are defined
3
+ assert :
4
+ that :
5
+ - mongodb_user_admin_name | length != 0
6
+ - mongodb_user_admin_password | length != 0
7
+ - mongodb_root_admin_name | length != 0
8
+ - mongodb_root_admin_password | length != 0
9
+ - mongodb_root_backup_name | length != 0
10
+ - mongodb_root_backup_password | length != 0
11
+ fail_msg : " Please set the user, password variables to Mongodb!"
2
12
3
13
- name : Check value of variable mongodb_net_ssl_host
4
14
fail :
5
15
msg : ' Set mongodb_net_ssl_mode is preferSSL or set valid hostname for mongodb_net_ssl_host!'
6
16
when : ( mongodb_net_ssl_mode == 'requireSSL'
7
- and mongodb_net_ssl_host == '' )
17
+ and mongodb_net_ssl_host | length > 0 )
8
18
9
19
- name : Check value of variable mongodb_login_host
10
20
fail :
13
23
and mongodb_net_ssl_host != mongodb_login_host
14
24
and not mongodb_replication_replset )
15
25
26
+ - name : Check if password is default
27
+ include : warning_default_password.yml
28
+ tags : [mongodb]
29
+
16
30
- name : Include OS-specific variables
17
31
include_vars : " {{ item }}"
18
32
with_first_found :
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Check passwords
3
+ fail :
4
+ msg : " [WARNING]: Using default password to user: {{ item.user }}"
5
+ ignore_errors : yes
6
+ loop :
7
+ - user : " {{ mongodb_user_admin_name }}"
8
+ password : " {{ mongodb_user_admin_password }}"
9
+ - user : " {{ mongodb_root_admin_name }}"
10
+ password : " {{ mongodb_root_admin_password }}"
11
+ - user : " {{ mongodb_root_backup_name }}"
12
+ password : " {{ mongodb_root_backup_password }}"
13
+ when : item.password == "passw0rd"
14
+ run_once : yes
You can’t perform that action at this time.
0 commit comments