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 11---
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!"
212
313- name : Check value of variable mongodb_net_ssl_host
414 fail :
515 msg : ' Set mongodb_net_ssl_mode is preferSSL or set valid hostname for mongodb_net_ssl_host!'
616 when : ( mongodb_net_ssl_mode == 'requireSSL'
7- and mongodb_net_ssl_host == '' )
17+ and mongodb_net_ssl_host | length > 0 )
818
919- name : Check value of variable mongodb_login_host
1020 fail :
1323 and mongodb_net_ssl_host != mongodb_login_host
1424 and not mongodb_replication_replset )
1525
26+ - name : Check if password is default
27+ include : warning_default_password.yml
28+ tags : [mongodb]
29+
1630- name : Include OS-specific variables
1731 include_vars : " {{ item }}"
1832 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