1
- Stouts.mongo
1
+ Ansible role for MongoDB
2
2
============
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 ) .
7
4
Ansible role which manage [ MongoDB] ( http://www.mongodb.org/ )
8
5
9
6
* Install and configure the MongoDB;
@@ -13,46 +10,39 @@ Ansible role which manage [MongoDB](http://www.mongodb.org/)
13
10
#### Variables
14
11
15
12
``` yaml
16
-
17
- mongodb_enabled : yes
18
-
19
13
mongodb_package : mongodb-org
20
14
21
15
mongodb_additional_packages :
22
- - python-selinux
23
16
- python-pymongo
24
17
25
18
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' }}"
27
20
28
- mongodb_conf_auth : no # Run with security
21
+ mongodb_conf_auth : false # Run with security
29
22
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
31
24
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
37
30
mongodb_conf_logpath : /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout
38
31
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
42
36
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
44
38
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
46
40
47
41
# Replica set options:
48
42
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
56
46
57
47
# MMS Agent
58
48
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: ""
61
51
mongodb_mms_base_url : https://mms.mongodb.com
62
52
63
53
# Log rotation
64
- mongodb_logrotate : yes # Rotate mongodb logs.
54
+ mongodb_logrotate : true # Rotate mongodb logs.
65
55
mongodb_logrotate_options :
66
56
- compress
67
57
- copytruncate
68
58
- daily
69
59
- dateext
70
60
- rotate 7
71
61
- 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
72
89
` ` `
73
90
74
91
#### Usage
75
92
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.
79
94
95
+ Example vars for authorization :
80
96
` ` ` 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
+ }
89
105
` ` `
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
90
114
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
+ ` ` `
92
120
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.
94
122
95
123
# ### Feedback, bug-reports, requests, ...
96
124
97
- Are [welcome](https://github.com/Stouts/Stouts. mongodb/issues)!
125
+ Are [welcome](https://github.com/UnderGreen/ansible-role- mongodb/issues)!
0 commit comments