Host parameter not working in provisioning template

Hello,

I'm running Foreman 1.14 and have an issue with host parameters not
available in user_data template.

In the template I have:
<%= @host.params['myparam'] %>

On the host creation page, in the parameter tab, I add a host param
'myparam' with value 'test'.
Once created, the 'Preview' template correctly shows the param value.

But the generated template on the target machine (in /var/lib/cloud…) does
not contain the param value (it is empty).

If I set the parameter on hostgroup or subnet then it works as expected.
The problem is only with params at host level.

Any help would be much appreciated.

Anthony

ps: output of <%= @host.params %> does not show host params but only params
from hostgroup, subnet, domain…

This is probably related to: #19465
<Bug #19465: User data template rendering does not render host parameters - Foreman>

··· On Tuesday, June 20, 2017 at 7:49:14 AM UTC-5, Anthony Chevalet wrote: > > Hello, > > I'm running Foreman 1.14 and have an issue with host parameters not > available in user_data template. > > In the template I have: > <%= @host.params['myparam'] %> > > On the host creation page, in the parameter tab, I add a host param > 'myparam' with value 'test'. > Once created, the 'Preview' template correctly shows the param value. > > But the generated template on the target machine (in /var/lib/cloud..) > does not contain the param value (it is empty). > > If I set the parameter on hostgroup or subnet then it works as expected. > The problem is only with params at host level. > > Any help would be much appreciated. > > Anthony > > > >

Bug created: Bug #20062: Host parameter not working in provisioning
template <Bug #20062: Host parameter not working in provisioning template - Foreman>

··· 2017-06-20 14:57 GMT+02:00 Anthony Chevalet :

ps: output of <%= @host.params %> does not show host params but only
params from hostgroup, subnet, domain…


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/foreman-users/Bs0FaIUZeUc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.