try to add databases

This commit is contained in:
Robert Kaussow 2018-07-08 15:22:24 +02:00
parent 5960c38f7b
commit 70f74d005e
2 changed files with 18 additions and 1 deletions

View 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

View File

@ -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