Skip to content

Commit ecff84d

Browse files
author
Sergei Antipov
committed
Merge branch 'master' of github.com:UnderGreen/ansible-role-mongodb
2 parents c9b2612 + a82e1c5 commit ecff84d

File tree

8 files changed

+411
-129
lines changed

8 files changed

+411
-129
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 6 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

CONTRIBUTORS

Lines changed: 0 additions & 4 deletions
This file was deleted.

LICENSE

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE.md

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 72 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
Stouts.mongo
1+
Ansible role for MongoDB
22
============
3-
4-
[![Build Status](http://img.shields.io/travis/Stouts/Stouts.mongodb.svg?style=flat-square)](https://travis-ci.org/Stouts/Stouts.mongodb)
5-
[![Galaxy](http://img.shields.io/badge/galaxy-Stouts.mongodb-blue.svg?style=flat-square)](https://galaxy.ansible.com/list#/roles/982)
6-
3+
This repository forked from [Stouts.mongodb](https://github.com/Stouts/Stouts.mongodb).
74
Ansible role which manage [MongoDB](http://www.mongodb.org/)
85

96
* Install and configure the MongoDB;
@@ -13,46 +10,39 @@ Ansible role which manage [MongoDB](http://www.mongodb.org/)
1310
#### Variables
1411

1512
```yaml
16-
17-
mongodb_enabled: yes
18-
1913
mongodb_package: mongodb-org
2014

2115
mongodb_additional_packages:
22-
- python-selinux
2316
- python-pymongo
2417

2518
mongodb_user: mongodb
26-
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' == mongodb_package) else 'mongodb' }}"
19+
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}"
2720

28-
mongodb_conf_auth: no # Run with security
21+
mongodb_conf_auth: false # Run with security
2922
mongodb_conf_bind_ip: 127.0.0.1 # Comma separated list of ip addresses to listen on
30-
mongodb_conf_cpu: yes # Periodically show cpu and iowait utilization
23+
mongodb_conf_cpu: true # Periodically show cpu and iowait utilization
3124
mongodb_conf_dbpath: /data/db # Directory for datafiles
32-
mongodb_conf_fork: no # Fork server process
33-
mongodb_conf_httpinterface: no # Enable http interface
34-
mongodb_conf_ipv6: no # Enable IPv6 support (disabled by default)
35-
mongodb_conf_journal: no # Enable journaling
36-
mongodb_conf_logappend: yes # Append to logpath instead of over-writing
25+
mongodb_conf_fork: false # Fork server process
26+
mongodb_conf_httpinterface: false # Enable http interface
27+
mongodb_conf_ipv6: false # Enable IPv6 support (disabled by default)
28+
mongodb_conf_journal: true # Enable journaling
29+
mongodb_conf_logappend: true # Append to logpath instead of over-writing
3730
mongodb_conf_logpath: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout
3831
mongodb_conf_maxConns: 1000000 # Max number of simultaneous connections
39-
mongodb_conf_noprealloc: no # Disable data file preallocation
40-
mongodb_conf_noscripting: no # Disable scripting engine
41-
mongodb_conf_notablescan: no # Do not allow table scans
32+
mongodb_conf_noprealloc: false # Disable data file preallocation
33+
mongodb_conf_smallfiles: false # Disable smallfiles option
34+
mongodb_conf_noscripting: false # Disable scripting engine
35+
mongodb_conf_notablescan: false # Do not allow table scans
4236
mongodb_conf_port: 27017 # Specify port number
43-
mongodb_conf_quota: no # Limits each database to a certain number of files
37+
mongodb_conf_quota: false # Limits each database to a certain number of files
4438
mongodb_conf_quotaFiles: 8 # Number of quota files
45-
mongodb_conf_syslog: no # Log to system's syslog facility instead of file
39+
mongodb_conf_syslog: false # Log to system's syslog facility instead of file
4640

4741
# Replica set options:
4842
mongodb_conf_replSet: # Enable replication <setname>[/<optionalseedhostlist>]
49-
mongodb_conf_replIndexPrefetch: all # specify index prefetching behavior (if secondary) [none|_id_only|all]
50-
51-
mongodb_shell: {} # Define mongo shell commands to run
52-
# Syntax: mongodb_shell:
53-
# dbname:
54-
# - db.setProfilingLevel(1, 50)
55-
43+
mongodb_conf_replIndexPrefetch: "all" # specify index prefetching behavior (if secondary) [none|_id_only|all]
44+
mongodb_conf_oplogSize: 512 # specifies a maximum size in megabytes for the replication operation log
45+
mongodb_conf_keyFile: /etc/mongodb-keyfile # Specify path to keyfile with password for inter-process authentication
5646

5747
# MMS Agent
5848
mongodb_mms_agent_pkg: https://mms.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager_1.4.2.783-1_amd64.deb
@@ -61,37 +51,75 @@ mongodb_mms_api_key: ""
6151
mongodb_mms_base_url: https://mms.mongodb.com
6252

6353
# Log rotation
64-
mongodb_logrotate: yes # Rotate mongodb logs.
54+
mongodb_logrotate: true # Rotate mongodb logs.
6555
mongodb_logrotate_options:
6656
- compress
6757
- copytruncate
6858
- daily
6959
- dateext
7060
- rotate 7
7161
- size 10M
62+
63+
# password for inter-process authentication
64+
# please regenerate this file on production environment with command 'openssl rand -base64 741'
65+
mongodb_keyfile_content: |
66+
8pYcxvCqoe89kcp33KuTtKVf5MoHGEFjTnudrq5BosvWRoIxLowmdjrmUpVfAivh
67+
CHjqM6w0zVBytAxH1lW+7teMYe6eDn2S/O/1YlRRiW57bWU3zjliW3VdguJar5i9
68+
Z+1a8lI+0S9pWynbv9+Ao0aXFjSJYVxAm/w7DJbVRGcPhsPmExiSBDw8szfQ8PAU
69+
2hwRl7nqPZZMMR+uQThg/zV9rOzHJmkqZtsO4UJSilG9euLCYrzW2hdoPuCrEDhu
70+
Vsi5+nwAgYR9dP2oWkmGN1dwRe0ixSIM2UzFgpaXZaMOG6VztmFrlVXh8oFDRGM0
71+
cGrFHcnGF7oUGfWnI2Cekngk64dHA2qD7WxXPbQ/svn9EfTY5aPw5lXzKA87Ds8p
72+
KHVFUYvmA6wVsxb/riGLwc+XZlb6M9gqHn1XSpsnYRjF6UzfRcRR2WyCxLZELaqu
73+
iKxLKB5FYqMBH7Sqg3qBCtE53vZ7T1nefq5RFzmykviYP63Uhu/A2EQatrMnaFPl
74+
TTG5CaPjob45CBSyMrheYRWKqxdWN93BTgiTW7p0U6RB0/OCUbsVX6IG3I9N8Uqt
75+
l8Kc+7aOmtUqFkwo8w30prIOjStMrokxNsuK9KTUiPu2cj7gwYQ574vV3hQvQPAr
76+
hhb9ohKr0zoPQt31iTj0FDkJzPepeuzqeq8F51HB56RZKpXdRTfY8G6OaOT68cV5
77+
vP1O6T/okFKrl41FQ3CyYN5eRHyRTK99zTytrjoP2EbtIZ18z+bg/angRHYNzbgk
78+
lc3jpiGzs1ZWHD0nxOmHCMhU4usEcFbV6FlOxzlwrsEhHkeiununlCsNHatiDgzp
79+
ZWLnP/mXKV992/Jhu0Z577DHlh+3JIYx0PceB9yzACJ8MNARHF7QpBkhtuGMGZpF
80+
T+c73exupZFxItXs1Bnhe3djgE3MKKyYvxNUIbcTJoe7nhVMrwO/7lBSpVLvC4p3
81+
wR700U0LDaGGQpslGtiE56SemgoP
82+
83+
# names and passwords for administrative users
84+
mongodb_user_admin_name: siteUserAdmin
85+
mongodb_user_admin_password: passw0rd
86+
87+
mongodb_root_admin_name: siteRootAdmin
88+
mongodb_root_admin_password: passw0rd
7289
```
7390
7491
#### Usage
7592
76-
Add `Stouts.mongodb` to your roles and set vars in your playbook file.
77-
78-
Example:
93+
Add `greendayonfire.mongodb` to your roles and set vars in your playbook file.
7994

95+
Example vars for authorization:
8096
```yaml
81-
82-
- hosts: all
83-
84-
roles:
85-
- Stouts.mongodb
86-
87-
vars:
88-
mongodb_conf_port: 27400
97+
mongodb_conf_auth: true
98+
mongodb_users:
99+
- {
100+
name: testUser,
101+
password: passw0rd,
102+
roles: readWrite,
103+
database: app_development
104+
}
89105
```
106+
Required vars to change on production:
107+
```yaml
108+
mongodb_user_admin_password
109+
mongodb_root_admin_password
110+
```
111+
Example vars for replication:
112+
```yaml
113+
mongodb_login_host: 192.168.56.2 # Mongodb master host
90114
91-
#### License
115+
# mongodb_replication_params should be configured on each replica set node
116+
mongodb_replication_params:
117+
- { host_name: 192.168.56.2, host_port: "{{ mongodb_conf_port }}", host_type: replica }
118+
# host_type can be replica(default) and arbiter
119+
```
92120

93-
Licensed under the MIT License. See the LICENSE file for details.
121+
Licensed under the GPLv2 License. See the [LICENSE.md](LICENSE.md) file for details.
94122

95123
#### Feedback, bug-reports, requests, ...
96124

97-
Are [welcome](https://github.com/Stouts/Stouts.mongodb/issues)!
125+
Are [welcome](https://github.com/UnderGreen/ansible-role-mongodb/issues)!

test.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)