Just an update for everyone. The problem with validating that the referenced 
resource is in the catalog now has a solution (for the most part). You’d need 
to take advantage of the new `post_compile_hook` that should be supported in 
future versions of Puppet. I may write up a helper module later on that makes 
the whole reference parameter thing trivial.  

This is the PR with the mentioned hook. It has been merged:
https://github.com/puppetlabs/puppet/pull/1853

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



On Tuesday, August 27, 2013 at 12:40 PM, Andy Parker wrote:

> On Mon, Aug 26, 2013 at 5:38 PM, Thomas Linkin <tho...@puppetlabs.com 
> (mailto:tho...@puppetlabs.com)> wrote:
> > > > 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.  
> > >  
> > > Could you give some more details about what you are thinking of changing?
> > Sure!  
> >  
> > https://projects.puppetlabs.com/issues/22288  
> >  
>  
> Looks great. I left a common on the PR that you submitted to get a minor 
> cleanup.
>   
> > --  
> > Tom Linkin
> > Professional Services Engineer
> > http://puppetlabs.com/
> > twitter: @trlinkin
> >  
> >  
> >  
> >  
> > On Monday, August 26, 2013 at 12:41 PM, Andy Parker wrote:
> >  
> > > On Sat, Aug 24, 2013 at 8:09 PM, Tom Linkin <tho...@puppetlabs.com 
> > > (mailto:tho...@puppetlabs.com)> wrote:
> > > > Dominic,  
> > > >  
> > > > I have done this before: https://github.com/trlinkin/puppet-file_param  
> > > >  
> > >  
> > > A few other things have done this as well. Usually it is when there is a 
> > > "resource" that is needed to manage another resource, but isn't a 
> > > resource itself on disk. There was some network device management work 
> > > that used that pattern.  
> > >   
> > > > 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.
> > > >  
> > >  
> > > Yes, this is only possible during application right now.
> > >   
> > > >  
> > > > 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.
> > > >  
> > >  
> > > Could you give some more details about what you are thinking of changing?
> > >   
> > > > --  
> > > > 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 
> > > > (mailto:puppet-dev%2bunsubscr...@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.
> > >  
> > >  
> > >  
> > > --  
> > > Andrew Parker
> > > a...@puppetlabs.com (mailto:a...@puppetlabs.com)  
> > > Freenode: zaphod42
> > > Twitter: @aparker42
> > > Software Developer
> > >  
> > > Join us at PuppetConf 2013, August 22-23 in San Francisco - 
> > > http://bit.ly/pupconf13
> > > Register now and take advantage of the Final Countdown discount - save 
> > > 15%!
> > > --  
> > > 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 
> > (mailto:puppet-dev%2bunsubscr...@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.
>  
>  
>  
> --  
> Andrew Parker
> a...@puppetlabs.com (mailto:a...@puppetlabs.com)  
> Freenode: zaphod42
> Twitter: @aparker42
> Software Developer
>  
> Join us at PuppetConf 2014, September 23-24 in San Francisco
> --  
> 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