An ansible role to install and configure logrotate.
This role has been tested on
Ubuntu 16.04
andUbuntu 16.10
only.
-
logrotate_conf_dir
: location of additional logrotate configurations.- Default:
/etc/logrotate.d
- Default:
-
logrotate_conf_scripts
: list of scripts to configure rotations.- Default:
[]
- Default:
Each script in the list should conform to the following definition.
-
name
: a unique name for this script. usually the name of the service. e.g.nginx
- Required
-
path
: path to logfile. e.g/var/log/nginx/*.log
.- Required
-
options
: logrotate options.- Default:
[]
- Default:
-
postrotate
: scripts to execute after the rotation.- Default:
[]
- Default:
-
state
: state of this item.- Default:
present
- Options:
present
absent
- Default:
- hosts: all
vars:
logrotate_conf_scripts:
- name: semaphore
path: /var/log/semaphore/*.log
options:
- rotate 14
- daily
- compress
- delaycompress
- sharedscripts
- missingok
postrotate:
- /usr/sbin/service semaphore restart
roles:
- thedumbtechguy.logrotate
MIT / BSD
This role was created by TheDumbTechGuy ( twitter | blog | galaxy )
This role was built upon the original work of: