Skip to content

Commit 9cba79d

Browse files
committed
Merge pull request #20 from deimosfr/master
can set uid and gid of mongodb user
2 parents e85c17a + 7828ad5 commit 9cba79d

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ mongodb_disable_thp: true
1919
mongodb_manage_service: true
2020

2121
mongodb_user: mongodb
22+
mongodb_uid:
23+
mongodb_gid:
2224
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}"
2325

2426
mongodb_conf_auth: false # Run with security

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mongodb_disable_thp: true
88
mongodb_manage_service: true
99

1010
mongodb_user: mongodb
11+
mongodb_uid:
12+
mongodb_gid:
1113
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}"
1214

1315
mongodb_conf_auth: false # Run with security

tasks/configure.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
---
22

3+
- name: set mongodb gid
4+
group: name=mongodb gid={{ mongodb_gid }} state=present
5+
when: mongodb_gid
6+
7+
- name: set mongodb uid
8+
user: name=mongodb uid={{ mongodb_uid }} group=mongodb state=present
9+
when: mongodb_uid
10+
311
- name: Register default MongoDB listen IP
412
set_fact: mongodb_listen_ip=127.0.0.1
513
when: ansible_local.mongodb.mongodb.mongodb_listen_ip is undefined

0 commit comments

Comments
 (0)