]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Docroot back as a normal resource, but testing for multiple definitions
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Nov 2009 15:58:55 +0000 (13:58 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Nov 2009 15:58:55 +0000 (13:58 -0200)
manifests/init.pp

index 287b2f5ec00dfc1ee958022f535720cad462d3ad..f8dd454f364481610f58a6be6980eb9718dc84ff 100644 (file)
@@ -108,12 +108,13 @@ class apache {
                   && [ ${apache2_sites}-enabled/$name -ef ${apache2_sites}-available/$name ]'",
           notify  => Exec["reload-apache2"],
         }
-        @file { "${docroot}":
-          ensure => directory,
-          owner  => root,
-          group  => root,
-          mode   => 0755,
-          tag    => "apache_docroot",
+        if !defined(File["${docroot}"]) {
+          file { "${docroot}":
+            ensure => directory,
+            owner  => root,
+            group  => root,
+            mode   => 0755,
+          }
         }
       }
       'absent': {
@@ -166,7 +167,4 @@ class apache {
     command     => "/etc/init.d/apache2 force-reload",
     refreshonly => true,
   }
-
-  # Realize all docroot resources
-  File <| tag == "apache_docroot" |>
 }