diff --git a/README.md b/README.md index 56b92287..362421c3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/defaults/main.yml b/defaults/main.yml index 6a4c25d6..0dafae3d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/configure.yml b/tasks/configure.yml index 181810e9..8f694b32 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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