Moved mongodb_user task into auth_init
This commit is contained in:
parent
9442794314
commit
a3a4b61c46
|
@ -33,6 +33,19 @@
|
|||
roles: "root"
|
||||
}
|
||||
|
||||
- name: create normal users
|
||||
mongodb_user:
|
||||
database: "{{ item.database }}"
|
||||
name: "{{ item.name }}"
|
||||
password: "{{ item.password }}"
|
||||
roles: "{{ item.roles }}"
|
||||
replica_set: "{{ mongodb_conf_replSet }}"
|
||||
login_user: "{{ mongodb_user_admin_name }}"
|
||||
login_password: "{{ mongodb_user_admin_password }}"
|
||||
login_port: "{{ mongodb_conf_port }}"
|
||||
with_items:
|
||||
- "{{ mongodb_users }}"
|
||||
|
||||
- name: Move back mongod.conf
|
||||
template: src=mongod.conf.j2 dest=/etc/mongod.conf owner=root group=root mode=0644
|
||||
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
when: mongodb_conf_auth and not mongodb_conf_replSet
|
||||
tags: [mongodb]
|
||||
|
||||
- include: user_add.yml
|
||||
when: mongodb_conf_auth and mongodb_users
|
||||
tags: [mongodb]
|
||||
|
||||
- include: mms-agent.yml
|
||||
when: mongodb_mms_api_key != ""
|
||||
tags: [mongodb]
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
---
|
||||
|
||||
- name: create normal users
|
||||
mongodb_user:
|
||||
database: "{{ item.database }}"
|
||||
name: "{{ item.name }}"
|
||||
password: "{{ item.password }}"
|
||||
roles: "{{ item.roles }}"
|
||||
replica_set: "{{ mongodb_conf_replSet }}"
|
||||
login_user: "{{ mongodb_user_admin_name }}"
|
||||
login_password: "{{ mongodb_user_admin_password }}"
|
||||
login_port: "{{ mongodb_conf_port }}"
|
||||
with_items:
|
||||
- "{{ mongodb_users }}"
|
Loading…
Reference in New Issue