25 lines
626 B
YAML
25 lines
626 B
YAML
---
|
|
- include_tasks: install.yml
|
|
|
|
- include_tasks: storage.yml
|
|
when: mongodb_lvm_enabled
|
|
|
|
- include_tasks: config.yml
|
|
|
|
- name: Check where admin user already exists
|
|
command: |
|
|
mongo --quiet -u {{ mongodb_user_admin_name }} -p {{ mongodb_user_admin_password }} --eval 'db.version()' admin
|
|
register: __mongodb_admin_check
|
|
changed_when: False
|
|
failed_when: False
|
|
when: mongodb_rbac_enabled
|
|
|
|
- include_tasks: auth.yml
|
|
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
|