1
This commit is contained in:
parent
1cff05f44f
commit
4680706c6b
2 changed files with 72 additions and 0 deletions
7
roles/rocky9/tasks/logrotate.yml
Normal file
7
roles/rocky9/tasks/logrotate.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
- name: Set logrotate rsyslog
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: logrotate-rsyslog.j2
|
||||||
|
dest: /etc/logrotate.d/rsyslog
|
||||||
|
mode: "0644"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
65
roles/rocky9/templates/logrotate-rsyslog.j2
Normal file
65
roles/rocky9/templates/logrotate-rsyslog.j2
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
/var/log/cron {
|
||||||
|
daily
|
||||||
|
rotate {{ logrotate_interval }}
|
||||||
|
size 50M
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/systemctl reload rsyslog.service 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
/var/log/maillog {
|
||||||
|
daily
|
||||||
|
rotate {{ logrotate_interval }}
|
||||||
|
size 50M
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/systemctl reload rsyslog.service 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
/var/log/secure {
|
||||||
|
daily
|
||||||
|
rotate {{ logrotate_interval }}
|
||||||
|
size 50M
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/systemctl reload rsyslog.service 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
/var/log/spooler
|
||||||
|
{
|
||||||
|
daily
|
||||||
|
rotate {{ logrotate_interval }}
|
||||||
|
compress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/systemctl -s HUP kill rsyslog.service >/dev/null 2>&1 || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
|
|
||||||
|
/var/log/messages {
|
||||||
|
daily
|
||||||
|
rotate {{ logrotate_interval }}
|
||||||
|
size 50M
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
missingok
|
||||||
|
notifempty
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
/usr/bin/systemctl reload rsyslog.service 2> /dev/null || true
|
||||||
|
endscript
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue