guidugli.logrotate
Ansible Role: logrotate
This Ansible Role installs and sets up logrotate on RHEL/CentOS, Fedora, and Debian/Ubuntu.
Requirements
No special requirements are needed.
Role Variables
Here are the available variables and their default values (found in defaults/main.yml):
logrotate_config_files: "{{ logrotate_files_to_copy }}"
This variable specifies which files you want to copy to the logrotate.d directory.
logrotate_compress: no
Set to yes to make logrotate compress rotated files by default.
logrotate_use_date_extension: yes
Set to yes to use the date in the file name instead of just numbers.
logrotate_weeks2keep: 24
This sets how many weeks you want to keep the rotated logs.
The following variables do not need to be changed for the systems you are targeting (see vars/main.yml):
logrotate_packages:
Packages required to install logrotate.
logrotate_conf:
Location of the configuration file.
logrotate_files_to_copy:
A list of configuration files to be copied, located in the
files
directory.
Dependencies
There are no dependencies.
Example Playbook
- hosts: servers
roles:
- { role: guidugli.logrotate }
License
MIT / BSD
Author Information
This role was created in 2020 by Carlos Guidugli.
ansible-galaxy install guidugli.logrotate