copr: virtlogd rotate logs for hypervisors

Configure virtlogd to rotate logs older than 30 days. The default config
does not delete anything since we log to a lot of small files which are
ignored by the max size to rotate in default virtlogd config.
This commit is contained in:
Jiri Kyjovsky 2025-04-19 19:06:25 +02:00
parent 9531326ca5
commit e07d13ee4e
3 changed files with 23 additions and 0 deletions

View file

@ -0,0 +1,7 @@
# We log each WM that has beed spawned to a log and once it shuts down
# the log is closed and we keep that small log. New machines logs their
# output to new file. So this way we keep the small logs of each WM
# for 30 days.
max_age_days = 30
log_root = "/var/log/libvirt/qemu"

View file

@ -0,0 +1,5 @@
---
- name: Reload virtlogd
ansible.builtin.service:
name: virtlogd
state: reloaded

View file

@ -200,3 +200,14 @@
provision_directory: /home/copr/provision
provision_user: copr
tags: always
- name: Deploy virtlogd.conf
ansible.builtin.copy:
src: virtlogd.conf
dest: /etc/libvirt/virtlogd.conf
owner: root
group: root
mode: '0644'
notify: Reload virtlogd
tags:
- config