History of possible usage of EPP URIs in the form of "'puppet:///<module>/<file>.epp"?

19 views
Skip to first unread message

David Karr

unread,
May 22, 2016, 8:26:31 PM5/22/16
to Puppet Users
In "Learning Puppet 4", there are a couple of variations of calls to the "epp" function.  Some of them use the syntax that I find in the actual Puppet docs, which is just "<module>/<file>.epp", but some of them use something that looks more like a URI, like "puppet:///<module>/<file>.epp".  I've determined that the former is the only syntax that Puppet 4 accepts, unless I'm missing some configuration option.  Did Puppet ever use the "puppet:///<module>/<file>.epp" syntax, and if so, what was the history of that going away?

Henrik Lindberg

unread,
May 22, 2016, 8:37:22 PM5/22/16
to puppet...@googlegroups.com
It would be great if you could include pointers to where the different
notations can be found.

IIRC, the implementation of EPP use the same resolution to find a
template as the ERB template support does, so some investigation is
needed to find the real answer. The documentation / examples may be in
error too.

- henrik


> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/c3459fdd-bc57-4c20-873c-a6f17b8c2577%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/c3459fdd-bc57-4c20-873c-a6f17b8c2577%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

David Karr

unread,
May 22, 2016, 9:07:43 PM5/22/16
to Puppet Users
On Sunday, May 22, 2016 at 5:37:22 PM UTC-7, Henrik Lindberg wrote:
On 23/05/16 02:26, David Karr wrote:
> In "Learning Puppet 4", there are a couple of variations of calls to the
> "epp" function.  Some of them use the syntax that I find in the actual
> Puppet docs, which is just "<module>/<file>.epp", but some of them use
> something that looks more like a URI, like
> "puppet:///<module>/<file>.epp".  I've determined that the former is the
> only syntax that Puppet 4 accepts, unless I'm missing some configuration
> option.  Did Puppet ever use the "puppet:///<module>/<file>.epp" syntax,
> and if so, what was the history of that going away?
>

It would be great if you could include pointers to where the different
notations can be found.

You mean within the book?  If that's what you mean, I can provide approximate search locations, but I'm reading the book on Safari, so I don't have page numbers.

The first occurrence is where the "epp()" function syntax is first mentioned, in chapter 13, section "Using Puppet EPP Templates".  On this page, it has two clear examples, one using the "<module>/<file>.epp" form, and the other using the "puppet:///<module>/<file>.epp" form, and the text that describes the required syntax only mentions the latter.

The next occurrence is in chapter 14, section "Calling Other Modules", and this example uses the "puppet:///<module>/<file>.epp" syntax.

I believe these are the only locations within the book that talk about the syntax of the argument to the "epp()" function.
 

IIRC, the implementation of EPP use the same resolution to find a
template as the ERB template support does, so some investigation is
needed to find the real answer. The documentation / examples may be in
error too.

The book indicated that the ERB template syntax uses "<module>/<file>.epp", but I didn't test that.
 

Henrik Lindberg

unread,
May 22, 2016, 9:22:17 PM5/22/16
to puppet...@googlegroups.com
On 23/05/16 03:07, David Karr wrote:
> On Sunday, May 22, 2016 at 5:37:22 PM UTC-7, Henrik Lindberg wrote:
>
> On 23/05/16 02:26, David Karr wrote:
> > In "Learning Puppet 4", there are a couple of variations of calls
> to the
> > "epp" function. Some of them use the syntax that I find in the
> actual
> > Puppet docs, which is just "<module>/<file>.epp", but some of them
> use
> > something that looks more like a URI, like
> > "puppet:///<module>/<file>.epp". I've determined that the former
> is the
> > only syntax that Puppet 4 accepts, unless I'm missing some
> configuration
> > option. Did Puppet ever use the "puppet:///<module>/<file>.epp"
> syntax,
> > and if so, what was the history of that going away?
> >
>
> It would be great if you could include pointers to where the different
> notations can be found.
>
>
> You mean within the book? If that's what you mean, I can provide
> approximate search locations, but I'm reading the book on Safari, so I
> don't have page numbers.
>
Duh, book - I did not read carefully enough. :-) I though you found
examples in the puppet documentation or puppet site.

> The first occurrence is where the "epp()" function syntax is first
> mentioned, in chapter 13, section "Using Puppet EPP Templates". On this
> page, it has two clear examples, one using the "<module>/<file>.epp"
> form, and the other using the "puppet:///<module>/<file>.epp" form, and
> the text that describes the required syntax only mentions the latter.
>
> The next occurrence is in chapter 14, section "Calling Other Modules",
> and this example uses the "puppet:///<module>/<file>.epp" syntax.
>
> I believe these are the only locations within the book that talk about
> the syntax of the argument to the "epp()" function.
>
>
>
> IIRC, the implementation of EPP use the same resolution to find a
> template as the ERB template support does, so some investigation is
> needed to find the real answer. The documentation / examples may be in
> error too.
>
>
> The book indicated that the ERB template syntax uses
> "<module>/<file>.epp", but I didn't test that.
>

The official documentation is here:
https://docs.puppet.com/puppet/latest/reference/lang_template.html#referencing-files

- henrik

>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/9b00b220-6501-4209-827a-4368dacac105%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/9b00b220-6501-4209-827a-4368dacac105%40googlegroups.com?utm_medium=email&utm_source=footer>.

David M. Karr

unread,
May 22, 2016, 9:33:36 PM5/22/16
to puppet...@googlegroups.com
I had a feeling there was some confusion there. :) I had earlier found
the official doc page (that you reference below), and it references the
"<module>/<file>.epp" syntax, which is the only one I found to work. I
did report this in the book errata list, if it matters.

By your lack of an answer to my original actual question, I'm guessing
you know of no ancient Puppet implementation history where the
"puppet:///<module>/<file>.epp" syntax was valid? Although the syntax as
described this way in the book obviously doesn't work in Puppet 4 (and
the docs are consistent with that), I find it hard to believe the author
came up with this syntax on a lark :) , which makes me think that this
used to be valid at some point in the past.

>
>> The first occurrence is where the "epp()" function syntax is first
>> mentioned, in chapter 13, section "Using Puppet EPP Templates". On this
>> page, it has two clear examples, one using the "<module>/<file>.epp"
>> form, and the other using the "puppet:///<module>/<file>.epp" form, and
>> the text that describes the required syntax only mentions the latter.
>>
>> The next occurrence is in chapter 14, section "Calling Other Modules",
>> and this example uses the "puppet:///<module>/<file>.epp" syntax.
>>
>> I believe these are the only locations within the book that talk about
>> the syntax of the argument to the "epp()" function.
>>
>>
>>
>> IIRC, the implementation of EPP use the same resolution to find a
>> template as the ERB template support does, so some investigation is
>> needed to find the real answer. The documentation / examples may
>> be in
>> error too.
>>
>>
>> The book indicated that the ERB template syntax uses
>> "<module>/<file>.epp", but I didn't test that.
>>
>
> The official documentation is here:
> https://docs.puppet.com/puppet/latest/reference/lang_template.html#referencing-files
>

Yup, found that already. Thanks.

Eric Sorenson

unread,
May 23, 2016, 2:32:08 PM5/23/16
to Puppet Users, Jo Rhett
I'm CC'ing Jo Rhett directly here in case he doesn't come across this organically --

The only place the puppet:/// syntax has ever been valid is in the 'source' attribute for File resources; the epp function, like template(), is expanded on the master during compilation and the contents are included in the catalog so it doesn't make sense to include a URL reference (which would be expanded on the agent).

--eric0
Reply all
Reply to author
Forward
0 new messages