From 9ae989d30df8778c9c67dded8c1f3211ca46f73c Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 3 Sep 2012 09:13:13 +0200 Subject: only manage things if the file should be present --- manifests/vhost/file.pp | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/manifests/vhost/file.pp b/manifests/vhost/file.pp index c3f82c1..4b0416a 100644 --- a/manifests/vhost/file.pp +++ b/manifests/vhost/file.pp @@ -10,24 +10,26 @@ define lighttpd::vhost::file( owner => root, group => 0, mode => 0644; } - case $content { - 'absent': { - File["/etc/lighttpd/vhosts.d/${name}.conf"]{ - source => $vhost_source ? { - 'absent' => [ - "puppet:///modules/site_lighttpd/vhosts.d/${::fqdn}/${name}.conf", - "puppet:///modules/site_lighttpd/vhosts.d/${lighttpd::cluster_node}/${name}.conf", - "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}.${::lsbdistcodename}/${name}.conf", - "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}/${name}.conf", - "puppet:///modules/site_lighttpd/vhosts.d/${name}.conf" - ], - default => "puppet:///${vhost_source}", + if $ensure != 'absent' { + case $content { + 'absent': { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + source => $vhost_source ? { + 'absent' => [ + "puppet:///modules/site_lighttpd/vhosts.d/${::fqdn}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${lighttpd::cluster_node}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}.${::lsbdistcodename}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${::operatingsystem}/${name}.conf", + "puppet:///modules/site_lighttpd/vhosts.d/${name}.conf" + ], + default => "puppet:///${vhost_source}", + } } } - } - default: { - File["/etc/lighttpd/vhosts.d/${name}.conf"]{ - content => $content, + default: { + File["/etc/lighttpd/vhosts.d/${name}.conf"]{ + content => $content, + } } } } -- cgit v1.2.3