amrset <[email protected]> writes:
> Daniel Pittman wrote:
>> amrset <[email protected]> writes:
>>
>>> Would it be possible to do something like:
>>>
>>> file { "/foo/voo/bar/baz" :
[...]
>>> }
>>
>> Isn't that just:
>>
>> file { "/foo": owner => "foo", recurse => true }
>> file { "/foo/voo/bar/baz": owner => "baz", recurse => true }
>>
>> ...since the second instance is more specific, so will override the first
>> instance?
>
> A few issues - first - which one would run first?  (order would matter
> right?)

All the usual ordering meta-parameters are going to work as expected, so you
can have the second depend on the first.

> Second - right now, if a parent directory doesn't exist, ie - if "bar" below
> doesn't exist:
>
> file { "/foo/voo/bar/baz" :
>   ensure => directory.
> ...
> }
>
> then the file resource throws an error that it can't create "baz" as it
> currently can't deal with missing parent directories.

*nod*  You would need to either guard the declaration against machines that
don't have the second hierarchy, specify the entire hierarchy, or enhance
puppet not to complain.

> Another issue - what if $mydir is multiple (dynamic) levels of directory,
> and I need to create and/or maintain /foo/${mydir}/bar/baz ...

Well, you can substitute variables into the name of the file, so
"/foo/${mydir}" will work literally as written.

> What if some of the tree exists on one computer and none on another?  What
> will the permissions/ownership be?

The rules apply recursively from whatever root you give, so the behaviour is
as if they were independently specified.


I don't *know* this solves your problem as described, and I have had cases
where I *do* want complex behaviour from a recursive ownership action, but
I think current puppet can be made to dance to your current tune.

        Daniel
-- 
✣ Daniel Pittman            ✉ [email protected]            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

-- 
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