From 2d34c72c583ca584dfcbec7cb00c27d470164b0f Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 4 Jun 2015 20:53:39 +0000 Subject: [PATCH] Override the default syslog logrotate on notifs-backend01 as its messaages log grows very very large over time. Rotate it daily, compress with xz and only keep 7 days. Can adjust from there. --- roles/notifs/backend/files/syslog-logrotate | 20 ++++++++++++++++++++ roles/notifs/backend/tasks/main.yml | 6 ++++++ 2 files changed, 26 insertions(+) create mode 100644 roles/notifs/backend/files/syslog-logrotate diff --git a/roles/notifs/backend/files/syslog-logrotate b/roles/notifs/backend/files/syslog-logrotate new file mode 100644 index 0000000000..7028290a18 --- /dev/null +++ b/roles/notifs/backend/files/syslog-logrotate @@ -0,0 +1,20 @@ +/var/log/cron +/var/log/maillog +/var/log/messages +/var/log/secure +/var/log/spooler +{ + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + endscript + daily + rotate 7 + missingok + ifempty + compress + compresscmd /usr/bin/xz + uncompresscmd /usr/bin/xz + compressext .xz + dateext +} diff --git a/roles/notifs/backend/tasks/main.yml b/roles/notifs/backend/tasks/main.yml index d74f18eb7c..5781d5e087 100644 --- a/roles/notifs/backend/tasks/main.yml +++ b/roles/notifs/backend/tasks/main.yml @@ -40,3 +40,9 @@ tags: - notifs - notifs/backend + +- name: override the default syslog logrotate file + copy: src=syslog-logrotate dest=/etc/logrotate.d/syslog + tags: + - notifs + - notifs/backend