forked from infra/ansible
common: limit syslog retention to 7 days
This commit is contained in:
parent
d97524798b
commit
f184ca15fe
37
roles/common/files/rsyslog
Normal file
37
roles/common/files/rsyslog
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/var/log/syslog
|
||||||
|
{
|
||||||
|
rotate 7
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
delaycompress
|
||||||
|
compress
|
||||||
|
postrotate
|
||||||
|
/usr/lib/rsyslog/rsyslog-rotate
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
|
||||||
|
/var/log/mail.info
|
||||||
|
/var/log/mail.warn
|
||||||
|
/var/log/mail.err
|
||||||
|
/var/log/mail.log
|
||||||
|
/var/log/daemon.log
|
||||||
|
/var/log/kern.log
|
||||||
|
/var/log/auth.log
|
||||||
|
/var/log/user.log
|
||||||
|
/var/log/lpr.log
|
||||||
|
/var/log/cron.log
|
||||||
|
/var/log/debug
|
||||||
|
/var/log/messages
|
||||||
|
{
|
||||||
|
rotate 7
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/lib/rsyslog/rsyslog-rotate
|
||||||
|
endscript
|
||||||
|
}
|
@ -63,3 +63,8 @@
|
|||||||
regexp: "^#?MaxRetentionSec=.*"
|
regexp: "^#?MaxRetentionSec=.*"
|
||||||
line: "MaxRetentionSec=7day"
|
line: "MaxRetentionSec=7day"
|
||||||
notify: Restart journald
|
notify: Restart journald
|
||||||
|
|
||||||
|
- name: Configure log retention
|
||||||
|
copy: src={{ item }} dest=/etc/logrotate.d/{{ item }}
|
||||||
|
with_items:
|
||||||
|
- rsyslog
|
||||||
|
Loading…
Reference in New Issue
Block a user