Moved mongodb_user task into auth_init

This commit is contained in:
Sergei Antipov 2015-06-22 15:27:32 +06:00
parent 9442794314
commit a3a4b61c46
3 changed files with 13 additions and 18 deletions

View File

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

View File

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

View File

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