Bug 1416425

Summary: Job template description format doesnt accept input field variables when invoked
Product: Red Hat Satellite Reporter: Göran Törnqvist <goran.tornqvist>
Component: Remote ExecutionAssignee: Ivan Necas <inecas>
Status: CLOSED ERRATA QA Contact: Adam Ruzicka <aruzicka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2.6CC: aruzicka, bbuckingham, inecas, jcallaha
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Göran Törnqvist 2017-01-25 13:20:45 UTC
Description of problem:
I´ve created a custom job template where I cloned the Package Action - SSH Default template to my own custom template.

As description I have MyJob %{label} and I have a input field named label in the template which I fill in with a descriptive label when I run the job.

The variable label is however not rendered when the job is invoked and all jobs are just called "MyJob ".

If I do a foreman-tail when running the job it looks like the values are passed correctly.

==> /var/log/foreman/production.log <==
2017-01-25 13:52:20 [app] [I] Started POST "/job_invocations" for 172.20.123.105 at 2017-01-25 13:52:20 +0100
2017-01-25 13:52:20 [app] [I] Processing by JobInvocationsController#create as HTML
2017-01-25 13:52:20 [app] [I]   Parameters: {"utf8"=>"✓", "authenticity_token"=>"5rhjFz52yxya/eRFFaeaUhunevNauPi8pmYxCkP9gSI=", "job_invocation"=>{"job_category"=>"Packages", "providers"=>{"SSH"=>{"job_template_id"=>"247", "job_templates"=>{"93"=>{"input_values"=>"[FILTERED]", "effective_user"=>""}, "247"=>{"input_values"=>"[FILTERED]"}}}}, "description"=>"MyJob example-label", "description_override"=>"MyJob %{label}", "description_format"=>"MyJob %{label}", <snip>}

The built in templates works fine however and the variables are rendered correctly in Description format when invoked.

Version-Release number of selected component (if applicable):
Satellite 6.2.6

How reproducible:
Always

Steps to Reproduce:
1. Copy an existing template
2. Add a new input field
3. Add the input field name in Description format as: %{inputfield}

Actual results:
Description format doesn´t render variables

Expected results:
Variables should be rendered

Additional info:

Comment 3 Ivan Necas 2017-01-30 09:04:02 UTC
Created redmine issue http://projects.theforeman.org/issues/18298 from this bug

Comment 4 Ivan Necas 2017-01-30 09:05:21 UTC
I run into this issue recently and I have a fix almost ready to send. The patch should be available soon.

Comment 5 Satellite Program 2017-01-30 23:11:19 UTC
Upstream bug assigned to inecas

Comment 6 Satellite Program 2017-01-30 23:11:23 UTC
Upstream bug assigned to inecas

Comment 7 Satellite Program 2017-02-01 13:12:02 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/18298 has been resolved.

Comment 8 Adam Ruzicka 2017-08-02 08:43:15 UTC
Verified.
Satellite-6.3 Snap 9
Package versions:
satellite-6.3.0-16.0.beta.el7sat.noarch
tfm-rubygem-foreman_remote_execution-1.3.3-1.fm1_15.el7sat.noarch

Input field variables are properly interpolated in the description.

Comment 9 Satellite Program 2018-02-21 16:51:07 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336