Greetings.
mirrorlists have been collecting more logs in recent versions.
I'd like to apply the patch below to add a logrotate file to them to
keep this space under control.
Longer term we should merge this with upstream mirrormanager and just
have it in the package.
I have it keeping 30 days right now, but I am not sure if that is too
high or two low as I am not sure what we use these for, so suggestions
there would be welcome.
From a7dce4ea1a8fb05a933f75db6b77be7f5d8c16f9 Mon Sep 17 00:00:00 2001
From: Kevin Fenzi <kevin(a)scrye.com>
Date: Thu, 24 Mar 2016 20:22:21 +0000
Subject: [PATCH] Add a logrotate file for /var/log/mirrormanager/*.log files.
---
roles/mirrormanager/mirrorlist2/files/logrotate-mirrormanager | 9 +++++++++
roles/mirrormanager/mirrorlist2/tasks/main.yml | 5 +++++
2 files changed, 14 insertions(+)
create mode 100644 roles/mirrormanager/mirrorlist2/files/logrotate-mirrormanager
diff --git a/roles/mirrormanager/mirrorlist2/files/logrotate-mirrormanager
b/roles/mirrormanager/mirrorlist2/files/logrotate-mirrormanager
new file mode 100644
index 0000000..3ed8328
--- /dev/null
+++ b/roles/mirrormanager/mirrorlist2/files/logrotate-mirrormanager
@@ -0,0 +1,9 @@
+/var/log/mirrormanager/*.log
+{
+ compress
+ compresscmd /usr/bin/xz
+ uncompresscmd /usr/bin/xz
+ compressext .xz
+ daily
+ keep 30
+}
diff --git a/roles/mirrormanager/mirrorlist2/tasks/main.yml
b/roles/mirrormanager/mirrorlist2/tasks/main.yml
index b037d24..5183e4f 100644
--- a/roles/mirrormanager/mirrorlist2/tasks/main.yml
+++ b/roles/mirrormanager/mirrorlist2/tasks/main.yml
@@ -93,6 +93,11 @@
tags:
- mirrorlist2
+- name: setup logrotate log for mirrormanager log files
+ copy: src=logrotate-mirrormanager dest=/etc/logrotate.d/mirrormanager
+ tags:
+ - mirrorlist2
+
# Copy the mirrorlist log file every hour to be ready to be processed
- name: mirrorlist copy cron
cron: name="copy-mirrorlist" minute="50" hour="*/2"
user="mirrormanager"
--
1.8.3.1
Show replies by date