]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Do not use "su" in logrotate on squeeze
authorPeter Palfrader <peter@palfrader.org>
Fri, 28 Jun 2013 08:30:00 +0000 (10:30 +0200)
committerPeter Palfrader <peter@palfrader.org>
Fri, 28 Jun 2013 08:30:00 +0000 (10:30 +0200)
modules/dacs/files/common/dacs.logrotate [deleted file]
modules/dacs/manifests/init.pp
modules/dacs/templates/dacs.logrotate.erb [new file with mode: 0644]

diff --git a/modules/dacs/files/common/dacs.logrotate b/modules/dacs/files/common/dacs.logrotate
deleted file mode 100644 (file)
index 789e334..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-/var/log/dacs/*log {
-       daily
-       dateext
-       missingok
-       rotate 28
-       compress
-       delaycompress
-       create 640 www-data www-data
-       su root www-data
-       sharedscripts
-}
index f1d5496a07888170e8bb09895474db2298198d3b..3eb9392002667370ac855cfb3ea2286465d0fd04 100644 (file)
@@ -39,7 +39,7 @@ class dacs {
                purge   => true
        }
        file { '/etc/logrotate.d/dacs':
-               source  => 'puppet:///modules/dacs/common/dacs.logrotate',
+               content => template('dacs/dacs.logrotate.erb'),
                owner => root,
                group => root,
                mode  => '0644',
diff --git a/modules/dacs/templates/dacs.logrotate.erb b/modules/dacs/templates/dacs.logrotate.erb
new file mode 100644 (file)
index 0000000..5587631
--- /dev/null
@@ -0,0 +1,20 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+/var/log/dacs/*log {
+       daily
+       dateext
+       missingok
+       rotate 28
+       compress
+       delaycompress
+       create 640 www-data www-data
+<% if @lsbmajdistrelease >= '7' -%>
+       su root www-data
+<% else -%>
+       notifempty
+<% end -%>
+       sharedscripts
+}