On Mar 9, 6:20 am, Nick Moffitt <n...@zork.net>
wrote:> I recently found myself needing to perform a similar task to that
> desired by Udo Waechter in:
>
> https://groups.google.com/group/puppet-users/browse_thread/thread/ea6...
>
> Namely, I would like a file to exist on machine A iff any or all of
> machines B-Z have some other resource.
>
> My current line of thinking was that the best way to do this would be
> for B-Z to export some resource that had `require =>
Class["foo"]`.
> That way A could collect a whole bunch of things from B-Z and it
didn''t
> matter how many times that require happened.
>
> Of course this is fragile because of potential differences in import
> statements, but I''m willing to ignore that for a while. What
confuses
> me most is that #1885 may have classified my desired behavior as a bug:
>
> https://projects.puppetlabs.com/issues/1885
>
> The original poster wrote about unintended consequences involving outer
> defines and the way the AST is traversed,
buthttps://projects.puppetlabs.com/issues/1885#note-2is a comment (largely
> ignored?) from someone who appears to think that my desired approach is
> undesirable.
>
> Am I misguided in this approach? Will it not even work in modern
> puppets? Unfortunately stored configurations are one aspect of puppet
> where I can''t easily Just Test It Out.
Yes, I think you are misguided. I agree with the comments on issue
1885 that it doesn''t make sense for resource dependencies to be
exported / collected. However, it looks like you should be able to
adapt your approach by using Puppet''s feature for overriding
properties of collected resources. Example:
Myresource<<| [criteria] |>> {
require => Class["foo"]
}
The exporting nodes may pr may not place the same requirement.
That''s better all around because it separates the requirements of the
collecting node from those of the exporting nodes. Inasmuch as issue
1885 was supposedly fixed in Puppet 0.25, I would not expect your
original proposal to work in that or any later Puppet.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.