3657cacfca
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
22 lines
379 B
Django/Jinja
22 lines
379 B
Django/Jinja
{{ logrotate_file_name }} {
|
|
{% if logrotate_compress %}
|
|
compress
|
|
{% endif %}
|
|
{% if logrotate_copytruncate %}
|
|
copytruncate
|
|
{% endif %}
|
|
{% if logrotate_delaycompress %}
|
|
delaycompress
|
|
{% endif %}
|
|
{% if logrotate_missingok %}
|
|
missingok
|
|
{% endif %}
|
|
rotate {{ logrotate_rotate }}
|
|
{% if logrotate_daily %}
|
|
daily
|
|
{% endif %}
|
|
{% if logrotate_notifempty %}
|
|
notifempty
|
|
{% endif %}
|
|
}
|