Jira (PUP-11784) Running `puppet epp render` on a template fails subtemplates

12 views
Skip to first unread message

Anthony Vitacco (Jira)

unread,
Mar 17, 2023, 1:32:03 PM3/17/23
to puppe...@googlegroups.com
Anthony Vitacco created an issue
 
Puppet / Bug PUP-11784
Running `puppet epp render` on a template fails subtemplates
Issue Type: Bug Bug
Affects Versions: PUP 7.23.0
Assignee: Unassigned
Created: 2023/03/17 10:31 AM
Priority: Normal Normal
Reporter: Anthony Vitacco

Puppet Version: 7.23.0
Puppet Server Version: N/A
OS Name/Version: Arch Linux

When running puppet epp render template.epp against a template that contains an epp() call, puppet is unable to locate the sub-template.

Desired Behavior:

The template render to correctly locate the referenced templates.

Actual Behavior:

Running puppet epp render templates/main_template.hcl.epp yields the following output:

Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'module/elements/sub_template.hcl.epp' (file: /home/user/Projects/puppet/module/templates/main_template.hcl.epp, line: 51, column: 5)
Error: error while rendering epp
Error: Try 'puppet help epp render' for usage

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Anthony Vitacco (Jira)

unread,
Mar 17, 2023, 1:48:03 PM3/17/23
to puppe...@googlegroups.com
Anthony Vitacco updated an issue
Change By: Anthony Vitacco
*Puppet Version:* 7.23.0
*Puppet Server Version:* N/A
*OS Name/Version:* Arch Linux


When running {{puppet epp render template.epp}} against a template that contains an {{epp()}} call, puppet is unable to locate the sub-template.

*Desired Behavior:*


The template render to correctly locate the referenced templates.

*Actual Behavior:*


Running puppet epp render templates/main_template.hcl.epp yields the following output:

{{Error: Evaluation Error: Error while evaluating a Function Call, Could not find template 'module/elements/sub_template.hcl.epp' (file: /home/user/Projects/puppet/module/templates/main_template.hcl.epp, line: 51, column: 5)}}
{{Error: error while rendering epp}}
{{Error: Try 'puppet help epp render' for usage}}

  However, rendering the main_template in a file resource in a puppet module does work correctly.

Henrik Lindberg (Jira)

unread,
Mar 19, 2023, 8:59:02 AM3/19/23
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-11784
 
Re: Running `puppet epp render` on a template fails subtemplates

The epp tool simply does not set up that the call it makes to the epp function is made within the scope of a module. While it could look at the path of the given template file and assume this is from a module it may be better to add an option to the command --module <name> to force it to set up the context from which the call is made. This would also allow adding support for giving module relative template names. That would be of value to test that template files are placed at the expected location.

Tony Vu (Jira)

unread,
Mar 21, 2023, 4:11:02 PM3/21/23
to puppe...@googlegroups.com
Tony Vu updated an issue
 
Change By: Tony Vu
Labels: needs-validation

Josh Cooper (Jira)

unread,
Apr 4, 2023, 4:45:02 PM4/4/23
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11784
 
Re: Running `puppet epp render` on a template fails subtemplates

Anthony Vitacco could you provide example puppet code and epp templates, which one template referencing the other?

My understanding is when calling the epp function https://www.puppet.com/docs/puppet/7/function.html#epp, you have to specify a path like epp("MODULE/FILE.epp") so I think it's clear which module scope to use.

Tony Vu (Jira)

unread,
Apr 18, 2023, 4:35:01 PM4/18/23
to puppe...@googlegroups.com
Tony Vu commented on Bug PUP-11784

Anthony Vitacco just a ping on the above request for example puppet code and epp template.

Reply all
Reply to author
Forward
0 new messages