xoxys.mongodb/tasks/main.yml
Robert Kaussow ffa0073043
All checks were successful
continuous-integration/drone/push Build is passing
feat: add test for Rocky Linux 8 (#1)
2022-02-12 13:38:13 +01:00

25 lines
817 B
YAML

---
- 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
- include_tasks: install.yml
- 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