Does the user who initiates the auto provisioning have "view_params" permission?
If you start foreman-rake console and type:
Host.find(ID).host_param('param_name')
for the already provisioned host, do you get the expected result there?
Can you comment out line "return cached_host_params unless
cached_host_params.blank?" in host_params.rb and see if it helps?
On Wed, Nov 29, 2017 at 1:50 PM, Jacek Mierzwa <[email protected]> wrote:
> Thank you for your reply.
>
> Autoprovisioning doesn't really fail as a whole.
> It fails to retrieve hostgroup's OS parameter in the assigned template. As a
> result, I get empty fields instead of values in the rendered PXE template.
> Happens only when at least one hostgroup parameter exists (as explained in
> the original post).
> The managed host is indeed created and looks just fine.
>
> Example host - autoprovisioned few minutes ago - api curl result:
> https://pastebin.com/D80t368T
> Host's ENC data (YAML dump): https://pastebin.com/Ssezxv4Z
>
>
> Also, I find some inconsistencies in discovery auto-provision VS locations
> -- will start another topic for that.
> Thanks once again!
>
> On Tue, Nov 28, 2017 at 2:40 PM, <[email protected]> wrote:
>>
>>
>> I think if the autoprovisioning fails, managed host should be created
>> instead of the discovered one.
>>
>> Can you please send the result of GET /api/v2/hosts/<my-new-host-id>?
>>
>> Also I would like to see the result of host's ENC rendering. It should be
>> available through the UI:
>> 1. Go to hosts list
>> 2. Click on the new host
>> 3. Look for YAML button above host's properties table.
>>
>>
>> My wild guess would be that the OS is not set for the host for some
>> reason.
>>
>>
>>
>> On Tuesday, November 28, 2017 at 12:40:56 AM UTC+2, Garreat wrote:
>>>
>>> My Foreman version is: Version 1.15.6
>>> Discovery plugin: 9.1.5
>>>
>>> In my PXELinux provisioning template, I use the host_param('param_name')
>>> construct to access parameters assigned to the operating system. Just as
>>> described here:
>>> http://projects.theforeman.org/projects/foreman/wiki/templatewriting#Host-or-host-group-parameters
>>> .
>>> This works fine -- however...
>>>
>>> If a single hostgroup parameter exists (don't mistake with Puppet class
>>> parameter), then Discovery auto-provision fails to resolve the
>>> host_param('param_name') from the operating system parameters.
>>> <%= host_param('os_param_name') %> gets populated with nothing (empty
>>> string).
>>> Same goes for the old syntax <%= @host.params['parameter_name'] %> .
>>>
>>> This happens only when using auto-provision. Does not occur when:
>>> - using 'Provision' on a discovered host
>>> - using 'Build' on hosts page
>>> - using 'Rebuild config' on hosts page
>>>
>>>
>>> Probably just a minor code stuff... Help appreciated.
>>
>> --
>> 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/lT1x-_iye5I/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/foreman-users.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
>
> Jacek Mierzwa
> Systems Integration Engineer
>
> NOVOMATIC Technologies Poland S.A.
> (formerly ATSI S.A.)
>
> Krakowska 368Position
> 32-080 Zabierzów
> Poland, Europe
>
> Tel.: +48 12 617 67 15
> www.novomatic-tech.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Foreman users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/foreman-users.
> For more options, visit https://groups.google.com/d/optout.
--
Later,
Lukas @lzap Zapletal
--
You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.