try to add databases
This commit is contained in:
parent
5960c38f7b
commit
70f74d005e
10
tasks/add_db_with_auth.yml
Normal file
10
tasks/add_db_with_auth.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
- name: Create databases
|
||||||
|
mongodb_user:
|
||||||
|
login_user: "{{ mongodb_user_admin_name }}"
|
||||||
|
login_password: "{{ mongodb_user_admin_password }}"
|
||||||
|
database: unifi
|
||||||
|
name: unifiadm
|
||||||
|
password: password
|
||||||
|
roles: readWrite
|
||||||
|
state: present
|
@ -12,6 +12,13 @@
|
|||||||
register: __mongodb_admin_check
|
register: __mongodb_admin_check
|
||||||
changed_when: False
|
changed_when: False
|
||||||
failed_when: False
|
failed_when: False
|
||||||
|
when: mongodb_rbac_enabled
|
||||||
|
|
||||||
- include_tasks: auth.yml
|
- include_tasks: auth.yml
|
||||||
when: not __mongodb_admin_check.rc == 0
|
when: mongodb_rbac_enabled and not __mongodb_admin_check.rc == 0
|
||||||
|
|
||||||
|
- include_tasks: add_db_with_auth.yml
|
||||||
|
when: mongodb_rbac_enabled
|
||||||
|
|
||||||
|
- include_tasks: add_db.yml
|
||||||
|
when: not mongodb_rbac_enabled
|
||||||
|
Loading…
Reference in New Issue
Block a user