From 94b99fef7a85d9165b40e2dc01c5617824330826 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 21 Oct 2012 15:09:35 +0200 Subject: this include construct is only needed on centos systems --- manifests/base.pp | 7 ------- manifests/centos.pp | 21 ++++++++++++++++----- manifests/config/file.pp | 14 +++++++++----- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/manifests/base.pp b/manifests/base.pp index 0f942a5..3f2b799 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -33,13 +33,6 @@ class lighttpd::base { owner => 'root', group => 0, mode => '0644'; - "${lighttpd::conf_dir}/config.conf": - ensure => file, - require => Package['lighttpd'], - before => Service['lighttpd'], - owner => 'root', - group => 0, - mode => '0644'; '/etc/cron.daily/clean_lighttpd_compress': content => "find /var/cache/lighttpd/compress -type f -mtime +10 | xargs -r rm\n", require => Package['lighttpd'], diff --git a/manifests/centos.pp b/manifests/centos.pp index faa16e9..aa2bc1c 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,11 +1,22 @@ +# manage centos specific things for +# lighttpd class lighttpd::centos inherits lighttpd::base { + File{ + require => Package['lighttpd'], + before => Service['lighttpd'], + } file{ + "${lighttpd::conf_dir}/config.conf": + ensure => file, + owner => 'root', + group => 0, + mode => '0644'; '/var/cache/lighttpd': - ensure => directory, - require => Package['lighttpd']; + ensure => directory; '/var/cache/lighttpd/compress': - ensure => directory, - require => Package['lighttpd'], - owner => lighttpd, group => lighttpd, mode => 0640; + ensure => directory, + owner => 'lighttpd', + group => 'lighttpd', + mode => '0640'; } } diff --git a/manifests/config/file.pp b/manifests/config/file.pp index ca1abdd..8e361f7 100644 --- a/manifests/config/file.pp +++ b/manifests/config/file.pp @@ -13,11 +13,15 @@ define lighttpd::config::file( mode => '0644'; } - file_line{$name: - ensure => $ensure, - path => "${lighttpd::conf_dir}/config.conf", - line => "include \"${lighttpd::conf_dir_name}/${name}.conf\"", - notify => Service['lighttpd'], + case $operatingsystem { + centos,redhat,fedora: { + file_line{$name: + ensure => $ensure, + path => "${lighttpd::conf_dir}/config.conf", + line => "include \"${lighttpd::conf_dir_name}/${name}.conf\"", + notify => Service['lighttpd'], + } + } } case $content { -- cgit v1.2.3