zapier/ansible-logrotate

Name: ansible-logrotate

Owner: Zapier

Description: Ansible Galaxy role to setup logrotate and additional rotation scripts

Created: 2015-11-14 11:26:24.0

Updated: 2015-11-12 20:04:50.0

Pushed: 2015-11-14 11:27:50.0

Homepage:

Size: 352

Language: null

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status

Role Name

Installs logrotate and provides an easy way to setup additional logrotate scripts by specifying a list of directives.

Requirements

None

Role Variables

logrotate_scripts: A list of logrotate scripts and the directives to use for the rotation.

otate_scripts:
name: rails
path: "/srv/current/log/*.log"
options:
  - weekly
  - size 25M
  - missingok
  - compress
  - delaycompress
  - copytruncate
Dependencies

None

Example Playbook

Setting up logrotate for additional Nginx logs, with postrotate script.

otate_scripts:
name: nginx
path: /var/log/nginx/*.log
options:
  - weekly
  - size 25M
  - rotate 7
  - missingok
  - compress
  - delaycompress
  - copytruncate
scripts:
  postrotate: "[ -s /run/nginx.pid ] && kill -USR1 `cat /run/nginx.pid`"
License

BSD

Author Information

Find Nick Hammond on Twitter.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.