system-config/playbooks/roles/logrotate/README.rst
Ian Wienand 3657cacfca Add logrotate role and rotate ansible log files
Add a logrotate role that allows basic configuration of a logrotate
configuration for a specific log-file.

Use this role in the ansible-cron and install-ansible roles to ensure
the log output they are generating is rotated.

This role is not intended to manage the logrotate package (mostly to
avoid the overhead of frequently checking package state when this is
expected to be called for multiple configuration files on a server).
We add it as a base package to our servers.

Tests are added for testinfra.

Change-Id: I90f59c3e42c1135d6be120de38e942ece608b761
2018-09-05 09:15:46 +10:00

44 lines
1.1 KiB
ReStructuredText

Add log rotation file
.. note:: This role does not manage the ``logrotate`` package or
configuration directory, and it is assumed to be installed
and available.
This role installs a log rotation file in ``/etc/logrotate.d/`` for a
given file.
For information on the directives see ``logrotate.conf(5)``. This is
not an exhaustive list of directives (contributions are welcome).
** Role Variables **
.. zuul:rolevar:: logrotate_file_name
The log file on disk to rotate
.. zuul:rolevar:: logrotate_config_file_name
:default: Unique name based on :zuul:rolevar::`logrotate.logrotate_file_name`
The name of the configuration file in ``/etc/logrotate.d``
.. zuul:rolevar:: logrotate_compress
:default: yes
.. zuul:rolevar:: logrotate_copytruncate
:default: yes
.. zuul:rolevar:: logrotate_delaycompress
:default: yes
.. zuul:rolevar:: logrotate_missingok
:default: yes
.. zuul:rolevar:: logrotate_rotate
:default: 7
.. zuul:rolevar:: logrotate_daily
:default: yes
.. zuul:rolevar:: logrotate_notifempty
:default: yes