From 3088c95a0dee321c7793ee723aa8de3e556afdbb Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 9 Jan 2010 15:59:20 +0100 Subject: only manage the files if they are present --- manifests/web/repo/lighttpd.pp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/manifests/web/repo/lighttpd.pp b/manifests/web/repo/lighttpd.pp index b7ba9fd..6676c4d 100644 --- a/manifests/web/repo/lighttpd.pp +++ b/manifests/web/repo/lighttpd.pp @@ -5,11 +5,6 @@ define git::web::repo::lighttpd( ){ if $ensure == 'present' { include git::web::lighttpd } file{"/etc/lighttpd/gitweb.d/${name}.conf": } - if defined(Service['lighttpd']) { - File["/etc/lighttpd/gitweb.d/${name}.conf"]{ - notify => Service['lighttpd'], - } - } if $ensure == 'present' { File["/etc/lighttpd/gitweb.d/${name}.conf"]{ content => template("git/web/lighttpd"), @@ -24,7 +19,18 @@ define git::web::repo::lighttpd( ensure => $ensure, line => "include \"gitweb.d/${name}.conf\"", file => "/etc/lighttpd/lighttpd-gitweb.conf", - require => File['/etc/lighttpd/lighttpd-gitweb.conf'], - notify => Service['lighttpd'], + } + if defined(Service['lighttpd']) { + File["/etc/lighttpd/gitweb.d/${name}.conf"]{ + notify => Service['lighttpd'], + } + Line["include_of_gitwebrepo_${name}"]{ + notify => Service['lighttpd'], + } + } + if defined(File['/etc/lighttpd/lighttpd-gitweb.conf']){ + Line["include_of_gitwebrepo_${name}"]{ + require => File['/etc/lighttpd/lighttpd-gitweb.conf'], + } } } -- cgit v1.2.3