retr0h / ansible-logrotate

MIT License
8 stars 9 forks source link
ansible ansible-library logrotate

logrotate

A library which manages log rotate configurations.

Library ready status

Build Status Galaxy

Requirements

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