Dominic, 

I have done this before: https://github.com/trlinkin/puppet-file_param

You're right in assuming you will need to access the referenced resource during 
catalog application time. The only issue is that there is no way to know if the 
referenced resource is actually in the catalog until catalog application time. 
It would be nice to know if the reference cannot resolve before the catalog is 
sent to the agent and partially applied.

There is a hook for types that gets called when catalog compilation is 
complete, but it then only calls the relationship params giving them a chance 
to resolve their relationships. I'm currently working on a pull request to 
change that situation though. 

-- 
Tom Linkin
Professional Services Engineer
http://puppetlabs.com/
twitter: @trlinkin



On Friday, August 23, 2013 at 1:11 AM, Dominic Cleal wrote:

> On 21/08/13 21:12, Trevor Vaughan wrote:
> > Interesting. I was thinking that he would be using the resource as part
> > of a type value. I suppose if you pass it directly to the provider it
> > would work but it seems that any manipulation in the type itself
> > wouldn't work.
> > 
> > Happy to be wrong though.
> 
> I suspect there's some truth to what you're saying, depending on when
> the value's used. If I was trying to access the other resource from the
> type's parameter setter or similar, then I suspect this would be parse
> order dependent.
> 
> Using the other resource from a provider in the compiled catalog, should
> be late enough in the process that it's fully accessible.
> 
> Thanks for your feedback Dan and Trevor.
> 
> -- 
> Dominic Cleal
> Red Hat Engineering
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to puppet-dev+unsubscr...@googlegroups.com 
> (mailto:puppet-dev+unsubscr...@googlegroups.com).
> To post to this group, send email to puppet-dev@googlegroups.com 
> (mailto:puppet-dev@googlegroups.com).
> Visit this group at http://groups.google.com/group/puppet-dev.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-dev@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to