On Tue, Aug 7, 2012 at 11:13 AM, Krzysztof Wilczynski
<
krzysztof....@linux.com> 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