]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Ensuring folders exist with right modes and ownership
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Nov 2009 15:03:23 +0000 (13:03 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 8 Nov 2009 15:03:23 +0000 (13:03 -0200)
manifests/init.pp

index 73852f1865c8e05a1c13c00b6d2fca421d304d2a..3c6bcb5b10c6332e5c2f4673671f6c987230c8cf 100644 (file)
@@ -42,6 +42,7 @@ class apache {
   }
 
   service { "apache":
+    name       => "apache2",
     ensure     => running,
     require    => Package["apache"],
     hasstatus  => true,
@@ -73,7 +74,6 @@ class apache {
     '': { $apache_www_folder = '/var/www' }
   }
 
-  # TODO: ensure folders exist with right modes and ownership
   define site($ensure = present, $docroot = false, $redirect = false,
               $protocol = 'http', $server_alias = false, $use = false) {
     file { "${apache2_sites}-available/$title":
@@ -107,6 +107,12 @@ 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,
+        }
       }
       'absent': {
         exec { "/usr/sbin/a2dissite $name":