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:
parent
9531326ca5
commit
e07d13ee4e
3 changed files with 23 additions and 0 deletions
7
roles/copr/hypervisor/files/virtlogd.conf
Normal file
7
roles/copr/hypervisor/files/virtlogd.conf
Normal 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"
|
5
roles/copr/hypervisor/handlers/main.yml
Normal file
5
roles/copr/hypervisor/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Reload virtlogd
|
||||
ansible.builtin.service:
|
||||
name: virtlogd
|
||||
state: reloaded
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue