Skip to content

Ansible Galaxy role to setup logrotate and additional rotation scripts

Notifications You must be signed in to change notification settings

kagux/ansible-logrotate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • name - The name of the script that goes into /etc/logrotate.d/
  • path - Path to point logrotate to for the log rotation
  • options - List of directives for logrotate, view the logrotate man page for specifics
logrotate_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

logrotate_scripts:
  - name: nginx
    path: /var/log/nginx/*.log
    options:
      - weekly
      - size 25M
      - rotate 7
      - missingok
      - compress
      - delaycompress
      - copytruncate

License

BSD

Author Information

Find Nick Hammond on Twitter.

About

Ansible Galaxy role to setup logrotate and additional rotation scripts

Resources

Stars

Watchers

Forks

Packages

No packages published