What Michael said about the design is worth considering.

If it makes sense to reference another resource instead of a path string 
(e.g. File["myfile"]) and you're just curious about how to do it, there's 
code that does similar things in the puppetlabs/transition module, as well 
as in changes pending to the 2.x version of the puppetlabs/concat module

https://forge.puppetlabs.com/puppetlabs/transition
https://github.com/puppetlabs/puppetlabs-transition/blob/master/lib/puppet/provider/transition/ruby.rb

and

https://forge.puppetlabs.com/puppetlabs/concat
https://github.com/hunner/puppetlabs-concat/blob/c34231d130591d60d122fdab8c2fe794a17666ef/lib/puppet/type/concat.rb#L222

If you mean to do this in Puppet code rather than in a type/provider, there 
are evaluation-order considerations that make it generally inadvisable. 
However, there is a function for that.

https://forge.puppetlabs.com/puppetlabs/stdlib#getparam

It just needs to be very, very carefully used to the point which in almost 
all cases it would be better to just use a variable instead.

~Reid

>  

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/33462acb-e02a-4328-9030-a300a5ea5d51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to