Rotate mongodb logs.
This commit is contained in:
parent
e7795d144d
commit
513e601405
11
README.md
11
README.md
|
@ -11,6 +11,7 @@ Ansible role which manage [MongoDB](http://www.mongodb.org/)
|
|||
#### Variables
|
||||
|
||||
```yaml
|
||||
mongodb_enabled: yes
|
||||
mongodb_packages:
|
||||
- python-selinux
|
||||
- python-pymongo
|
||||
|
@ -33,6 +34,16 @@ mongodb_noscripting: false
|
|||
mongodb_notablescan: false
|
||||
mongodb_noprealloc: false
|
||||
mongodb_replSet: "" # Set for enable replication
|
||||
|
||||
# Log rotation
|
||||
mongodb_logrotate: yes # Rotate mongodb logs.
|
||||
mongodb_logrotate_options:
|
||||
- compress
|
||||
- copytruncate
|
||||
- daily
|
||||
- dateext
|
||||
- rotate 7
|
||||
- size 10M
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
|
|
@ -23,3 +23,13 @@ mongodb_noscripting: false
|
|||
mongodb_notablescan: false
|
||||
mongodb_noprealloc: false
|
||||
mongodb_replSet: "" # Set for enable replication
|
||||
|
||||
# Log rotation
|
||||
mongodb_logrotate: yes # Rotate mongodb logs.
|
||||
mongodb_logrotate_options:
|
||||
- compress
|
||||
- copytruncate
|
||||
- daily
|
||||
- dateext
|
||||
- rotate 7
|
||||
- size 10M
|
||||
|
|
|
@ -3,3 +3,7 @@
|
|||
- name: Configure mongodb
|
||||
template: src=mongodb.conf.j2 dest=/etc/mongodb.conf owner=root group=root mode=0644
|
||||
notify: mongodb reload
|
||||
|
||||
- name: Configure log rotation
|
||||
template: src=logrotate.conf.j2 dest=/etc/logrotate.d/mongodb.conf
|
||||
when: mongodb_logrotate
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
# This file was generated by Ansible for {{ ansible_fqdn }}
|
||||
# Do NOT modify this file by hand!
|
||||
|
||||
{{mongodb_logpath}} {
|
||||
{% for option in mongodb_logrotate_options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
}
|
Loading…
Reference in New Issue