From d7b28dd4fb8d9de74cd83d42cd7d70df5be100e1 Mon Sep 17 00:00:00 2001 From: Bogdan Radulescu Date: Thu, 7 Jan 2016 20:03:10 +0200 Subject: [PATCH] Added state for configuring logrotate --- apache/logrotate.sls | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 apache/logrotate.sls diff --git a/apache/logrotate.sls b/apache/logrotate.sls new file mode 100644 index 0000000..4f8039d --- /dev/null +++ b/apache/logrotate.sls @@ -0,0 +1,24 @@ +/etc/logrotate.d/apache2: + file: + - managed + - contents: | + /var/log/apache2/*.log { + daily + missingok + rotate 14 + compress + delaycompress + notifempty + create 640 root adm + sharedscripts + postrotate + if /etc/init.d/apache2 status > /dev/null ; then \ + /etc/init.d/apache2 reload > /dev/null; \ + fi; + endscript + prerotate + if [ -d /etc/logrotate.d/httpd-prerotate ]; then \ + run-parts /etc/logrotate.d/httpd-prerotate; \ + fi; \ + endscript + }