Problem:
I’m moving from satellite 6.3 to satellite 6.5, and we’ve got several custom templates.
The are differences in syntax that are causing issues.
For instance this code in the 6.3 environment works:
<%- @host.params[‘common_packages’].each_line do |package| -%>
But in the 6.5 environment I get:
undefined method '#params' for Host::Managed::Jail.
And based on that I converted similar references to use:
host_param(‘common_packages’), but as you can see from the original there’s more to the story that just getting all of the parameters.
In the original code it looks more like:
<% os_major = @host.operatingsystem.major.to_i %>
<%- @host.params[‘common_packages’].each_line do |package| -%>
<%= package.strip -%>
I know nothing of ERB, Ruby, etc., so I’m really struggling with converting the code.
I’m looking through templates provided by Red Hat, and might eventually get to a point where I’m might be able to cobble enough of it together, but am trying to get some help.
Other relevant data:
[e.g. logs from Foreman and/or the Proxy, modified templates, commands issued, etc]
(for logs, surround with three back-ticks to get proper formatting, e.g.)
Hello and welcome to the community! In Satellite 6.4 we’ve changed the user interface to params. You will need to modify all your templates, here is an example:
<%- host_param(‘common_packages’).each_line do |package| -%>
Note that we plan to reintroduce host_param macro to access host params on host object, so in 1.24+ due to report template usage, you’ll be able to write something like @host.host_param('common_packages')