Oefenweb.logrotated
logrotated
Manage logrotated.d in Debian-like systems.
Requirements
None
Variables
logrotated_logrotate_d_files[default:{}]:/etc/logrotated.d/*A list of application-specific file declarationslogrotated_logrotate_d_files.key: The name of the logrotated configuration file (e.gapache2)logrotated_logrotate_d_files.key.{n}[optional, default:[]]: A section declarationlogrotated_logrotate_d_files.key.{n}.logs[default:[]]: The log files for this sectionlogrotated_logrotate_d_files.key.{n}.size[optional]: Rotate logs when they reach this sizelogrotated_logrotate_d_files.key.{n}.daily[optional]: Whether or not log files are rotated every daylogrotated_logrotate_d_files.key.{n}.weekly[optional]: Whether or not log files are rotated weeklylogrotated_logrotate_d_files.key.{n}.monthly[optional]: Whether or not log files are rotated monthlylogrotated_logrotate_d_files.key.{n}.yearly[optional]: Whether or not log files are rotated yearlylogrotated_logrotate_d_files.key.{n}.missingok[optional]: Whether or not to go on to the next log file without issuing an error message when the log file is missinglogrotated_logrotate_d_files.key.{n}.rotate[optional]: Number of times log files are rotated (before being removed)logrotated_logrotate_d_files.key.{n}.compress[optional]: Whether or not old versions of log files are compressedlogrotated_logrotate_d_files.key.{n}.delaycompress[optional]: Whether or not to postpone compression of the previous log file to the next rotation cyclelogrotated_logrotate_d_files.key.{n}.copytruncate[optional]: Whether or not to truncate the original log file to zero size in place after creating a copylogrotated_logrotate_d_files.key.{n}.notifempty[optional]: Whether or not to not rotate the log if it is emptylogrotated_logrotate_d_files.key.{n}.create[optional]: Whether or not the log file is created immediately after rotation wit the given mode, owner and grouplogrotated_logrotate_d_files.key.{n}.sharedscripts[optional]: Whether or not the scripts are only run once, no matter how many logs match the wildcarded patternlogrotated_logrotate_d_files.key.{n}.scripts[optional, default:{}]: A hash of scriptslogrotated_logrotate_d_files.key.{n}.scripts.key[required]: Action to run the script (e.gpostrotate)logrotated_logrotate_d_files.key.{n}.scripts.key.{n}[default:[]]: List of lines with directives to execute
Dependencies
None
Example(s)
Simple configuration
---
- hosts: all
roles:
- oefenweb.logrotated
Complex configuration
---
- hosts: all
roles:
- oefenweb.logrotated
vars:
logrotated_logrotate_d_files:
apache2:
- logs:
- '/var/log/apache2/*.log'
weekly: true
missingok: true
rotate: 52
compress: true
delaycompress: true
notifempty: true
create: '640 root adm'
sharedscripts: true
scripts:
postrotate:
- 'if /etc/init.d/apache2 status > /dev/null ; then \'
- ' /etc/init.d/apache2 reload > /dev/null; \'
- 'fi;'
prerotate:
- 'if [ -d /etc/logrotate.d/httpd-prerotate ]; then \'
- ' run-parts /etc/logrotate.d/httpd-prerotate; \'
- 'fi;'
License
MIT
Author Information
- Mark van Driel
- Mischa ter Smitten
Feedback, bug-reports, requests, ...
Are welcome!
Install
ansible-galaxy install Oefenweb.logrotatedLicense
mit
Downloads
19.9k
Owner
