Project

General

Profile

Bug #11601

When using host-specific parameters, the rendering preview in job invocation renders to false

Added by Ivan Necas almost 7 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

1. use a job template that uses some host parameters, such as:

<% if @host.operatingsystem.family == "Redhat" && @host.operatingsystem.major.to_i > 6 %>
systemctl <%= input("action") %> <%= input("service") %>
<% else %>
service <%= input("service") %> <%= input("action") %>
<% end -%>

2. invoke a job with this template
3. the job invocation details page has `false` in the the rendering output

expected:

ability to choose what host the preview to render against?

Associated revisions

Revision bbee9e66 (diff)
Added by Marek Hulán almost 7 years ago

Fixes #11601 - do the preview for specific host if possible

Revision c1e01fa8
Added by Marek Hulán almost 7 years ago

Merge pull request #27 from ares/fix/11601

Fixes #11601 - do the preview for specific host if possible

History

#1 Updated by Stephen Benjamin almost 7 years ago

Oh thanks, I noticed that this morning and meant to file it. Foreman just passes an actual host to render its preview:

https://github.com/theforeman/foreman/blob/develop/app/controllers/templates_controller.rb#L83

I wonder if we just shouldn't provide a dummy object to it that converts any @host calls to something like `$HOST[operatingsystem][family]`

#2 Updated by Stephen Benjamin almost 7 years ago

Ah nevermind, that won't work, because the templates want some values to be able to render like an OS major and things.

#3 Updated by Marek Hulán almost 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Marek Hulán

A quick workaround will be rendering the preview for first host we have. Later we can improve (adding select box or displaying to preview in hosts tab)

#4 Updated by The Foreman Bot almost 7 years ago

  • Status changed from Assigned to Ready For Testing
  • Target version set to 85
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/27 added
  • Pull request deleted ()

#5 Updated by Marek Hulán almost 7 years ago

  • Legacy Backlogs Release (now unused) set to 81

#6 Updated by Marek Hulán almost 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF