Host.params in kick start while safemode render is enable


#1

can not add host.params in kick start while safemode render is enable

I added below parameter in kickstart template
subscription-manager register --org="<%= @host.rhsm_organization_label %>" --activationkey="<%=@host.params[‘kt_activation_keys’] %>"

Then I can not review kickstart template
Got below error in preview

image

Please help me.

**Foreman and Proxy versions::1.23-devlop nightly)
Katello Version : nightly

Thanks
Laxman


#2

created host parameter as below .
is it safe to disable safemode render ?

Thanks
Laxman


#3

Can you try host_params(‘kt_activation_keys') before disabling safemode?

Safemode simple disallows some constructs that can be unsafe, so depending on what you do it could be safe or not. I always try to leave it enabled.


#4

Haven’t we deprecated params macro? Use host_params now.


#5

Updated kt_activation_keys in kickstart template as you said. I didn’t change safemode render to false

subscription-manager register --org=Default_Organization --activationkey=<% host_params(‘kt_activation_keys’) %>

I got below error.

Thanks
Laxman


#6

It should be host_param (singular).


#7

I updated as below. It is working now

subscription-manager register --org=Default_Organization --activationkey="<%= host_param(‘kt_activation_keys’) %>"

Thanks
Laxman