On Sun, Sep 5, 2010 at 4:09 AM, Peter Meier <[email protected]> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>>> I assumed that when doing a directory and specifying recursive that it
>>> would create a directory along with any paths it needed, the way mkdir -p
>>> does.  However, that does not appear to be the case.  Does anyone know of a
>>> bug report or enhancement request for that?  If not, I'd be happy to file
>>> one and/or submit a patch for it.
>>
>> If what you are wanting is parent directories, that has been raised
>> before and, IIRC, the consensus was that that would cause more
>> problems than it would solve.  The core issue is that by implicitly
>> managing the directory resource you could wind up with it being
>> managed more than once and get conflicting settings for owner, rights,
>> etc.
>>
>> The conclusion the last time this came up is that you should
>> explicitly manage (and require) the parent directories.
>>
>> The recursion parameter is for going down into child directories, and
>> that should work.  If I;m misunderstanding your request and it doesn't
>> work for you, there may be a bug somewhere where, and that of course
>> should be fixed.
>
> You're talking about bug #86 [1], a very old bug report. and it has a
> very long discussion of different solutions and the different problems
> that these solutions bring with them.
>
> So as Markus said the current status (to not automagically manage parent
> directories) is the best solution in terms of that it is the one with
> the fewest problems.

I was thinking a function could work for the people who really want
this feature and that way we're not creating issues with the way the
file type actually works.

$mypath = "/usr/local/foo/bin"

file { path_components($mypath):
  ensure => directiory,
}

and path_components just returns an array:

['/usr', '/usr/local', '/usr/local/foo', '/usr/local/bin']




>
> pete
>
> [1] http://projects.puppetlabs.com/issues/86
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyDelEACgkQbwltcAfKi38v8QCglu5p3rkB3ombvoY8kvkUO9WD
> 1oAAnA5j7ugxVj3WzvC59D36e/SH1Rs6
> =Oyw7
> -----END PGP SIGNATURE-----
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" 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-dev?hl=en.
>
>



-- 
nigel

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en.

Reply via email to