can set uid and gid of mongodb user

This commit is contained in:
Deimosfr 2015-05-09 23:15:49 +02:00
parent e85c17a6e6
commit 7828ad5b92
3 changed files with 12 additions and 0 deletions

View File

@ -19,6 +19,8 @@ mongodb_disable_thp: true
mongodb_manage_service: true
mongodb_user: mongodb
mongodb_uid:
mongodb_gid:
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}"
mongodb_conf_auth: false # Run with security

View File

@ -8,6 +8,8 @@ mongodb_disable_thp: true
mongodb_manage_service: true
mongodb_user: mongodb
mongodb_uid:
mongodb_gid:
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}"
mongodb_conf_auth: false # Run with security

View File

@ -1,5 +1,13 @@
---
- name: set mongodb gid
group: name=mongodb gid={{ mongodb_gid }} state=present
when: mongodb_gid
- name: set mongodb uid
user: name=mongodb uid={{ mongodb_uid }} group=mongodb state=present
when: mongodb_uid
- name: Register default MongoDB listen IP
set_fact: mongodb_listen_ip=127.0.0.1
when: ansible_local.mongodb.mongodb.mongodb_listen_ip is undefined