Issue #86 has been updated by mario verbelen.

I have created myseld a patch on version 0.25.4

Then you can create "mkdir -p"

file { "/data/mysql/$hostname/db":
   ensure => directory,
   recurse => true
}

diff -up type/file/ensure.rb_ORIG type/file/ensure.rb
--- type/file/ensure.rb_ORIG    2010-02-09 10:01:29.000000000
+0100
+++ type/file/ensure.rb 2010-02-09 10:14:34.000000000 +0100
@@ -61,10 +61,14 @@ module Puppet
        newvalue(:directory) do
            mode = @resource.should(:mode)
            parent = File.dirname(@resource[:path])
-            unless FileTest.exists? parent
-                raise Puppet::Error,
-                    "Cannot create %s; parent directory %s does not exist" %
-                        [...@resource[:path], parent]
+            if @resource.recurse?
+                FileUtils.mkdir_p(parent)
+            else      
+                unless FileTest.exists? parent
+                    raise Puppet::Error,
+                        "Cannot create %s; parent directory %s does not exist" 
%
+                            [...@resource[:path], parent]
+                end       
            end       
            if mode   
                Puppet::Util.withumask(000) do
----------------------------------------
Feature #86: Directory creation fails if parent directory does not exist
http://projects.reductivelabs.com/issues/86

Author: Redmine Admin
Status: Accepted
Priority: Normal
Assigned to: 
Category: file
Target version: unplanned
Patch: None
Affected version: 0.24.7
Keywords: feature
Branch: 


I tried 

file {"/usr/local/share/puppet/sopext/facter" : 
  ensure => directory, 
  recurse => true
}

but get erros that the parent diretories are not available.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to