retr0h / ansible-logrotate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

logrotate

A library which manages log rotate configurations.

Library ready status

Build Status Galaxy

Requirements

  • Ansible >= 2.2

Dependencies

None

Example Playbook

- hosts: servers
  tasks:
    - name: Rotate /var/log/tomcat/myapp.log
      logrotate: name=myapp
                 path=/var/log/tomcat/myapp.log
      args:
        options:
          - daily
          - rotate 8
          - postrotate
          - exec script
          - endscript

    - name: rotate /var/log/wibble.log
      logrotate:
        name: wibble-log
        path: '/var/log/wibble*.log'
        options:
          - daily
          - size +1M
          - rotate 7
          - missingok
          - copytruncate
          - compress

Testing

Tests are performed by Molecule.

$ tox

License

MIT

About

License:MIT License


Languages

Language:Python 100.0%