diff options
author | mh <mh@immerda.ch> | 2012-09-03 09:13:13 +0200 |
---|---|---|
committer | mh <mh@immerda.ch> | 2012-09-03 09:13:13 +0200 |
commit | 9ae989d30df8778c9c67dded8c1f3211ca46f73c (patch) | |
tree | 8a95c6c544393b0b8be05571021e8d9ceebeba75 | |
parent | 36355e5065542a80eea4ca88e042bd9ecd9a86a3 (diff) | |
download | puppet-lighttpd-9ae989d30df8778c9c67dded8c1f3211ca46f73c.tar.gz puppet-lighttpd-9ae989d30df8778c9c67dded8c1f3211ca46f73c.tar.bz2 |
only manage things if the file should be present
-rw-r--r-- | manifests/vhost/file.pp | 34 |
1 files 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, + } } } } |