Skip to content

Commit

Permalink
Merge pull request #20 from deimosfr/master
Browse files Browse the repository at this point in the history
can set uid and gid of mongodb user
  • Loading branch information
UnderGreen committed May 10, 2015
2 parents e85c17a + 7828ad5 commit 9cba79d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9cba79d

Please sign in to comment.