diff --git a/roles/copr/hypervisor/files/virtlogd.conf b/roles/copr/hypervisor/files/virtlogd.conf deleted file mode 100644 index cc577799d8..0000000000 --- a/roles/copr/hypervisor/files/virtlogd.conf +++ /dev/null @@ -1,7 +0,0 @@ -# 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" diff --git a/roles/copr/hypervisor/tasks/main.yml b/roles/copr/hypervisor/tasks/main.yml index bbeac055be..bf8f6c71ff 100644 --- a/roles/copr/hypervisor/tasks/main.yml +++ b/roles/copr/hypervisor/tasks/main.yml @@ -201,13 +201,12 @@ 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 +- name: Ensure weekly cleanup of virtlogd/qemu logs older than 30 days + ansible.builtin.cron: + name: "Cleanup old virtlogd-qemu logs" + minute: 0 + hour: 3 + weekday: 1 + user: root + job: | + find /var/log/libvirt/qemu -maxdepth 1 -type f -name '*.log' -mtime +30 -delete