summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2010-10-17 13:25:27 +0200
committermh <mh@immerda.ch>2010-10-17 13:25:27 +0200
commitff988cdc1eac0f4aa5d15d5a8a64664b50c245fd (patch)
tree4ad992600c67d2d1534cf44fa6b3c6a758b7d8fb
parent9c1e8330bced02c09eae75127b4689902bd9d0c6 (diff)
downloadpuppet-lighttpd-ff988cdc1eac0f4aa5d15d5a8a64664b50c245fd.tar.gz
puppet-lighttpd-ff988cdc1eac0f4aa5d15d5a8a64664b50c245fd.tar.bz2
add cleanup cron for compressed files
According to http://redmine.lighttpd.net/wiki/1/Docs:ModCompress the cleanup compress is left to the user. As we enabled compress by default we also install a cleanup command by default.
-rw-r--r--manifests/base.pp56
1 files changed, 31 insertions, 25 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 8eb2b6d..3880b2e 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,30 +1,36 @@
class lighttpd::base {
- package{'lighttpd':
- ensure => installed,
- }
+ package{'lighttpd':
+ ensure => installed,
+ }
- service{lighttpd:
- ensure => running,
- enable => true,
- hasstatus => true,
- require => Package[lighttpd],
- }
+ service{lighttpd:
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ require => Package[lighttpd],
+ }
- file{'/etc/lighttpd/lighttpd.conf':
- source => [ "puppet:///modules/site-lighttpd/${fqdn}/lighttpd.conf",
- "puppet:///modules/site-lighttpd/lighttpd.conf",
- "puppet:///modules/lighttpd/${operatingsystem}/lighttpd.conf",
- "puppet:///modules/lighttpd/lighttpd.conf" ],
- require => Package['lighttpd'],
- notify => Service['lighttpd'],
- owner => root, group => 0, mode => 0644;
- }
+ file{'/etc/lighttpd/lighttpd.conf':
+ source => [ "puppet:///modules/site-lighttpd/${fqdn}/lighttpd.conf",
+ "puppet:///modules/site-lighttpd/lighttpd.conf",
+ "puppet:///modules/lighttpd/${operatingsystem}/lighttpd.conf",
+ "puppet:///modules/lighttpd/lighttpd.conf" ],
+ require => Package['lighttpd'],
+ notify => Service['lighttpd'],
+ owner => root, group => 0, mode => 0644;
+ }
- # ToDo: put that in a common module to share with apache
- file { 'default_lighttpd_index':
- path => '/var/www/lighttpd/index.html',
- ensure => file,
- content => template('lighttpd/default/default_index.erb'),
- owner => root, group => 0, mode => 0644;
- }
+ # ToDo: put that in a common module to share with apache
+ file { 'default_lighttpd_index':
+ path => '/var/www/lighttpd/index.html',
+ ensure => file,
+ content => template('lighttpd/default/default_index.erb'),
+ owner => root, group => 0, mode => 0644;
+ }
+
+ file{'/etc/cron.daily/clean_lighttpd_compress':
+ content => "find /var/cache/lighttpd/compress -type f -mtime +10 | xargs -r rm\n",
+ require => Package['lighttpd'],
+ owner => root, group => 0, mode => 0640;
+ }
}