- Removed environment variable lookups for logrotate settings in logrotate configuration files, replacing them with hardcoded values. - Updated the Ansible playbook to simplify project root, deploy user, and old server configurations by removing environment variable dependencies. - Added tasks to copy Zsh configuration files from an old server to the new server, ensuring proper permissions and cleanup of temporary files. - Enhanced logrotate configurations for bots and system logs to ensure consistent management of log files.
101 lines
1.7 KiB
Django/Jinja
101 lines
1.7 KiB
Django/Jinja
# Logrotate configuration for system services
|
|
# This file manages log rotation for system services
|
|
|
|
# Nginx logs
|
|
/var/log/nginx/*.log {
|
|
daily
|
|
missingok
|
|
rotate 30
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 www-data adm
|
|
sharedscripts
|
|
postrotate
|
|
if [ -f /var/run/nginx.pid ]; then
|
|
kill -USR1 `cat /var/run/nginx.pid`
|
|
fi
|
|
endscript
|
|
}
|
|
|
|
# System logs
|
|
/var/log/syslog {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 syslog adm
|
|
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 {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 syslog adm
|
|
sharedscripts
|
|
postrotate
|
|
/usr/lib/rsyslog/rsyslog-rotate
|
|
endscript
|
|
}
|
|
|
|
# Fail2ban logs
|
|
/var/log/fail2ban.log {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 root root
|
|
postrotate
|
|
systemctl reload fail2ban
|
|
endscript
|
|
}
|
|
|
|
# Docker daemon logs
|
|
/var/log/docker.log {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 root root
|
|
postrotate
|
|
systemctl reload docker
|
|
endscript
|
|
}
|
|
|
|
# Prometheus node exporter logs
|
|
/var/log/prometheus-node-exporter.log {
|
|
daily
|
|
missingok
|
|
rotate 7
|
|
compress
|
|
delaycompress
|
|
notifempty
|
|
create 0644 prometheus prometheus
|
|
postrotate
|
|
systemctl reload prometheus-node-exporter
|
|
endscript
|
|
}
|