Actions
Bug #38129
openTemplates starting with ERB comments will only export content after @host.hostname
Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
It appears that the Provisioning Template export functionality will only export a subset of the ERB template if the following is true:
- The template started with a ERB comment (i.e.
<%# \n -%>
) - The template has a ERB output in it of
name
or any content with the content "name" in it
As a minimal reproducible example, I have the following Provisioning Template in my Foreman instance:
<%#
%>
content that will not be exported
<%= name %>
content that will be exported
The output of both the API endpoint and the "export" button in the web UI is as follows:
<%#
name: testing
snippet: false
model: ProvisioningTemplate
kind: script
-%>
content that will be exported%
However, by either removing the ERB comment at the start of the file, or changing the expression printing tag to any other variable that does not contain 'name', the export endpoints will export the full file as expected.
This is found on Foreman version 3.10.0 running on AlmaLinux 9.4. I receive the same file subset on both Firefox and curl.
Updated by Devyn Keeney 4 months ago
- Description updated (diff)
Discovered other variables that triggered the same issue and found that just including "name" in the expression printing tag is enough to reproduce.
Actions