2017-07-14 21:05:30 +00:00
|
|
|
---
|
2022-02-12 12:38:13 +00:00
|
|
|
- include_vars: "{{ var_files }}"
|
|
|
|
vars:
|
|
|
|
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
|
|
|
|
params:
|
|
|
|
files:
|
|
|
|
- "{{ ansible_lsb.id | default('') | lower }}.yml"
|
|
|
|
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version }}.yml"
|
|
|
|
- "{{ ansible_os_family | lower }}.yml"
|
|
|
|
paths:
|
|
|
|
- "vars"
|
|
|
|
when: var_files
|
|
|
|
|
2018-07-10 20:51:02 +00:00
|
|
|
- include_tasks: install.yml
|
2018-07-10 20:54:01 +00:00
|
|
|
- include_tasks: config.yml
|
2018-07-07 21:20:00 +00:00
|
|
|
- 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
|
2018-07-08 00:09:26 +00:00
|
|
|
failed_when: False
|
2018-07-08 13:22:24 +00:00
|
|
|
when: mongodb_rbac_enabled
|
2018-07-07 16:53:03 +00:00
|
|
|
- include_tasks: auth.yml
|
2018-07-08 13:22:24 +00:00
|
|
|
when: mongodb_rbac_enabled and not __mongodb_admin_check.rc == 0
|