Project

General

Profile

Actions

Bug #38129

open

Templates starting with ERB comments will only export content after @host.hostname

Added by Devyn Keeney 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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.

Actions #1

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

Also available in: Atom PDF