noobient.logrotate

noobient.logrotate

Synopsys

This role enables log rotation for log files. Rotation occurs daily, and the files are compressed using the XZ compression.

Parameters

Name Required Example Description
name yes tomcat Nickname of the log rotation configuration.
pattern yes /var/log/foo.log Pattern(s) for the file(s) to rotate. You can specify multiple patterns, one line per pattern, see examples for syntax.
retention no 14 Number of days to keep the rotated log files. Defaults to 7.

Examples

- include_role:
    name: noobient.logrotate
  vars:
    name: kf2-ddos
    pattern: /var/log/kf2-ddos.log

- include_role:
    name: noobient.logrotate
  vars:
    name: tomcat
    pattern: |-
      /opt/tomcat/logs/*.log
      /opt/tomcat/logs/catalina.out
    retention: 14

Return Values

N/A

Support

Platform Support Status
Linter ✅ Lint
AlmaLinux 8 ✅ AlmaLinux 8
AlmaLinux 9 ✅ AlmaLinux 9
Fedora 38 ✅ Fedora 38
Fedora 39 ✅ Fedora 39
Ubuntu 18.04 ✅ Ubuntu 18.04
Ubuntu 20.04 ✅ Ubuntu 20.04
Ubuntu 22.04 ✅ Ubuntu 22.04
About

Enable log rotation for log files

Install
ansible-galaxy install noobient.logrotate
GitHub repository
License
mit
Downloads
966
Owner