Feature #17680
closedAllow accessing all template names for a host (in safe mode)
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1382735
Description of problem:
We have multiple release of RHEL x.y and for each release there is a kickstart template. Each kcikstart template requires a different set of kernel parameters to be supplied.
We do not like to hardcode these parameters in the PXE templates because that is unmaintenable because the template logic and parameters are then separated.
This RFE would like to have the hash of templates_used[<kindname>] available in both:
- Host API
- Template rendering under @host
use case PXE template using @host.templates_used['provisioning'] to include parameters on the kernel command line that are prefixed with the provisioning template name.
----
default linux
label linux
kernel <%= @kernel >
<= @host.inspect >
append initrd=<= @initrd > ks=<= foreman_url('provision')%> network <%= @host.params[@host.templates_used['provisioning']+'_kernel_opts'] || "" > <= @host.params['ks_kernel_opts'] || "" %>
ipappend 2
----
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1. Set common parameter 'TemplateABC_kernel_options' with value 'ABCDEF'
2. Create provisiong template 'TemplateABC' (content not relevant)
2. Create pxe template 'PXETemplateABC' with the content below
kernel options: XXX<%= @host.params[@host.templates_used['provisioning']+'_kernel_opts'] %>ZZZ
3. Create HostA
4. Associate HostA with TemplateABC and PXETemplateABC
5. Render PXETemplateABC
Actual results:
Output of 'kernel options: XXXZZZ' where the parmaeter is empty
Expected results:
Output of 'kernel options: XXXABCDEFZZZ' where the parameter with the provisioning template name is replaced
Additional info:
Updated by The Foreman Bot about 8 years ago
- Status changed from New to Ready For Testing
- Assignee set to Daniel Lobato Garcia
- Pull request https://github.com/theforeman/foreman/pull/4115 added
Updated by Anonymous almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 22439f753cbf76ad93cacdc5e48bbe1ce24f65c9.
Updated by Dominic Cleal almost 8 years ago
- Translation missing: en.field_release set to 209
Updated by Daniel Lobato Garcia almost 8 years ago
- Target version changed from 1.15.5 to 169