97 lines
3.6 KiB
Markdown
Raw Normal View History

2014-06-04 18:15:52 +04:00
Stouts.mongo
============
2014-10-23 00:59:11 +04:00
[![Build Status](http://img.shields.io/travis/Stouts/Stouts.mongodb.svg?style=flat-square)](https://travis-ci.org/Stouts/Stouts.mongodb)
2014-10-31 18:41:12 +03:00
[![Galaxy](http://img.shields.io/badge/galaxy-Stouts.mongodb-blue.svg?style=flat-square)](https://galaxy.ansible.com/list#/roles/982)
2014-06-04 19:09:28 +04:00
Ansible role which manage [MongoDB](http://www.mongodb.org/)
2014-12-19 17:39:09 +03:00
* Install and configure the MongoDB;
2014-06-04 19:09:28 +04:00
* Provide hanlers for restart and reload;
2014-12-19 17:39:09 +03:00
* Setup MMS authomation agent;
2014-06-04 19:09:28 +04:00
#### Variables
```yaml
2014-09-02 23:14:06 +01:00
2014-07-10 20:07:35 +04:00
mongodb_enabled: yes
mongodb_from_mongodb_repo: yes # If yes, install using MongoDB repo, else use system default repo
mongodb_additional_packages:
- python-selinux
- python-pymongo
2014-12-19 17:39:09 +03:00
mongodb_user: mongodb
mongodb_daemon_name: "{{ 'mongod' if (mongodb_from_mongodb_repo | bool) else 'mongodb' }}"
2014-12-19 17:39:09 +03:00
mongodb_conf_auth: no # Run with security
mongodb_conf_bind_ip: 127.0.0.1 # Comma separated list of ip addresses to listen on
mongodb_conf_cpu: yes # Periodically show cpu and iowait utilization
mongodb_conf_dbpath: /data/db # Directory for datafiles
mongodb_conf_fork: no # Fork server process
mongodb_conf_httpinterface: no # Enable http interface
mongodb_conf_ipv6: no # Enable IPv6 support (disabled by default)
mongodb_conf_journal: no # Enable journaling
mongodb_conf_logappend: yes # Append to logpath instead of over-writing
mongodb_conf_logpath: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout
2014-12-19 17:39:09 +03:00
mongodb_conf_maxConns: 1000000 # Max number of simultaneous connections
mongodb_conf_noprealloc: no # Disable data file preallocation
mongodb_conf_noscripting: no # Disable scripting engine
mongodb_conf_notablescan: no # Do not allow table scans
mongodb_conf_port: 27017 # Specify port number
mongodb_conf_quota: no # Limits each database to a certain number of files
mongodb_conf_quotaFiles: 8 # Number of quota files
mongodb_conf_syslog: no # Log to system's syslog facility instead of file
# Replica set options:
mongodb_conf_replSet: # Enable replication <setname>[/<optionalseedhostlist>]
mongodb_conf_replIndexPrefetch: all # specify index prefetching behavior (if secondary) [none|_id_only|all]
2014-12-26 18:36:50 +03:00
mongodb_shell: {} # Define mongo shell commands to run
2014-12-26 18:32:50 +03:00
# Syntax: mongodb_shell:
# dbname:
# - db.setProfilingLevel(1, 50)
2014-12-26 18:32:50 +03:00
2014-12-19 17:39:09 +03:00
# MMS Agent
mongodb_mms_agent_pkg: https://mms.mongodb.com/download/agent/automation/mongodb-mms-automation-agent-manager_1.4.2.783-1_amd64.deb
mongodb_mms_group_id: ""
mongodb_mms_api_key: ""
mongodb_mms_base_url: https://mms.mongodb.com
2014-07-10 20:07:35 +04:00
# Log rotation
mongodb_logrotate: yes # Rotate mongodb logs.
mongodb_logrotate_options:
- compress
- copytruncate
- daily
- dateext
- rotate 7
- size 10M
2014-06-04 19:09:28 +04:00
```
#### Usage
Add `Stouts.mongodb` to your roles and set vars in your playbook file.
Example:
```yaml
- hosts: all
roles:
2014-12-11 22:09:31 +03:00
- Stouts.mongodb
2014-06-04 19:09:28 +04:00
vars:
2014-12-11 22:09:31 +03:00
mongodb_conf_port: 27400
2014-06-04 19:09:28 +04:00
```
#### License
Licensed under the MIT License. See the LICENSE file for details.
#### Feedback, bug-reports, requests, ...
Are [welcome](https://github.com/Stouts/Stouts.mongodb/issues)!