logrotate
is an ansible role which:
- installs logrotate
- adds logrotate scripts
Using ansible-galaxy
:
$ ansible-galaxy install franklinkim.logrotate
Using requirements.yml
:
- src: franklinkim.logrotate
Using git
:
$ git clone https://github.com/weareinteractive/ansible-logrotate.git franklinkim.logrotate
- Ansible >= 1.9
Here is a list of all the default variables for this role, which are also available in defaults/main.yml
.
# logrotate_scripts:
# - name: nginx
# path: /var/log/nginx/*.log
# options:
# - daily
# - compress
# - rotate 6
# - missingok
# - copytruncate
# - delaycompress
# scripts:
# postrotate: "[ -s /run/nginx.pid ] && kill USR1 `cat /run/nginx.pid`"
#
# package name (version)
logrotate_package: logrotate
# script to install
logrotate_scripts: []
- hosts: all
sudo: yes
roles:
- franklinkim.logrotate
vars:
logrotate_scripts:
- name: syslog
path: /var/log/syslog
options:
- daily
- compress
- rotate 6
- missingok
- copytruncate
- delaycompress
$ git clone https://github.com/weareinteractive/ansible-logrotate.git
$ cd ansible-logrotate
$ vagrant up
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Copyright (c) We Are Interactive under the MIT license.