]> gitweb.fluxo.info Git - puppet-lighttpd.git/commitdiff
only manage things if the file should be present
authormh <mh@immerda.ch>
Mon, 3 Sep 2012 07:13:13 +0000 (09:13 +0200)
committermh <mh@immerda.ch>
Mon, 3 Sep 2012 07:13:13 +0000 (09:13 +0200)
manifests/vhost/file.pp

index c3f82c12cbdcbaaf86df7903c1f45f072a4eb241..4b0416a9cf016eb93e4b51d7cf717ea794dc13e1 100644 (file)
@@ -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,
+        }
       }
     }
   }