Add logrotate for forgejo

This commit is contained in:
flyingscorpio@clevo 2023-01-18 11:20:11 +01:00
parent bf6ddb08e6
commit 0192344ecc
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,9 @@
---
- name: Setup logrotate for forgejo logs
become: true
ansible.builtin.template:
src: forgejo.logrotate.j2
dest: /etc/logrotate.d/forgejo
owner: root
group: root
mode: 0644

View file

@ -24,5 +24,8 @@
- name: Include fail2ban tasks
ansible.builtin.include_tasks: fail2ban.yml
- name: Include logrotate tasks
ansible.builtin.include_tasks: logrotate.yml
- name: Include repos tasks
ansible.builtin.include_tasks: repos.yml

View file

@ -0,0 +1,13 @@
{{ forgejo_log_dir }}/*.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}