On Tue, Aug 7, 2012 at 11:13 AM, Krzysztof Wilczynski
<[email protected]> wrote:
> Hi James,
>
> [...]
>> How could I acheive this please?  I'd rather not hard-code the full path as 
>> this would be brittle - how can I "resolve" the puppet:/// url to the actual 
>> file location please?
>
> Using "puppet:///" and "file:///" in a way similar to what the File type 
> offers from within a custom function is actually not that straight-forward, 
> sadly. There is a lot of code which deals with resolving these URLs that 
> deals with SSL certificates (since you can request an artifact from different 
> Puppet Master), etc. I found it not that easy to work with outside of the 
> File type, but perhaps somebody was more successful than I was (?) :-)

Here's a function that loads a files in puppet module path which you
can alter to suit your needs:
https://gist.github.com/3289446

This uses the same path as templates so instead of puppet:///, just
module_file(module_name/file_name), and you can look at the template
function for some ideas as well.

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en.

Reply via email to