Ansible Role logrotate
This role ensures that logrotate is installed and configured for main classic system log files like /var/log/cron
, /var/log/maillog
or /var/log/messages
.
Additionally, this role allows you to deploy custom logrotate configs which are placed under {{ inventory_dir }}/host_files/{{ inventory_hostname }}/etc/logrotate.d
on the Ansible control node. Keep in mind that later config files may override the options given in earlier files, so the order in which the logrotate config files are listed is important.
Optional Role Variables
Variable |
Description |
Default Value |
---|---|---|
|
Number. Log files are rotated |
|
Example:
# optional
logrotate__rotate: 7