Hello,

I`m trying to use Foreman to provision some servers, but it looks like I`m 
stuck. 

I`m using a set of host parameters to tune template behaviour, defined in 
OS, Host Group and Host itself. But it looks like provisioning url ignores 
them all.
When I review template from UI, everything is fine, but when machine is 
installed defaults are used.

I`ve actually add this line to my template:
<%= @host.params %>

And results was as expected:
/unattended/provision?hostname=sds-03.scaleio.mediastage.tech (url from UI)
{"boot-delay"=>"10", "disable-firewall"=>"true", 
"http-proxy"=>"192.168.52.9:8118", "install-disk"=>"sda", 
"install-packages"=>"gentleman", "selinux"=>"disabled", "time-zone"=>"UTC", 
"salt_master"=>"foreman.mediastage.tech"}

/unattended/provision?token=d9959efa-6692-4909-8e6f-ebd45109ffae (from tftp 
boot config)
{"salt_master"=>"foreman.mediastage.tech"}

Logs for this two requests:
2016-12-06 13:10:31 f11777e9 [app] [I] Started GET 
"/unattended/provision?hostname=sds-03.scaleio.mediastage.tech" for 
192.168.53.2 at 2016-12-06 13:10:31 +0000
2016-12-06 13:10:31 f11777e9 [app] [I] Processing by 
UnattendedController#host_template as TEXT
2016-12-06 13:10:31 f11777e9 [app] [I]   Parameters: 
{"hostname"=>"sds-03.scaleio.mediastage.tech", "kind"=>"provision"}
2016-12-06 13:10:31 f11777e9 [app] [D] Setting current user thread-local 
variable to vspiridonov
2016-12-06 13:10:31 f11777e9 [app] [D] Found sds-03.scaleio.mediastage.tech
2016-12-06 13:10:31 f11777e9 [templates] [I] Rendering template 'Kickstart 
simple'
2016-12-06 13:10:31 f11777e9 [templates] [I] Rendering template 'RHEL 7.2 
kickstart'
2016-12-06 13:10:31 f11777e9 [templates] [I] Rendering template 'Kickstart 
simple'
2016-12-06 13:10:31 f11777e9 [templates] [I] Rendering template 
'centos_7_gentleman_packages'
2016-12-06 13:10:31 f11777e9 [templates] [I] Rendering template 
'kickstart_networking_setup'
2016-12-06 13:10:31 f11777e9 [app] [I]   Rendered inline template (322.8ms)
2016-12-06 13:10:31 f11777e9 [app] [I] Completed 200 OK in 427ms (Views: 
318.8ms | ActiveRecord: 17.9ms)
...
2016-12-06 13:10:35 f11777e9 [app] [I] Started GET 
"/unattended/provision?token=d9959efa-6692-4909-8e6f-ebd45109ffae" for 
192.168.53.2 at 2016-12-06 13:10:35 +0000
2016-12-06 13:10:35 f11777e9 [app] [I] Processing by 
UnattendedController#host_template as TEXT
2016-12-06 13:10:35 f11777e9 [app] [I]   Parameters: 
{"token"=>"d9959efa-6692-4909-8e6f-ebd45109ffae", "kind"=>"provision"}
2016-12-06 13:10:35 f11777e9 [app] [D] Found sds-03.scaleio.mediastage.tech
2016-12-06 13:10:35 f11777e9 [templates] [I] Rendering template 'Kickstart 
simple'
2016-12-06 13:10:35 f11777e9 [app] [D] Setting current user thread-local 
variable to foreman_admin
2016-12-06 13:10:35 f11777e9 [templates] [I] Rendering template 'RHEL 7.2 
kickstart'
2016-12-06 13:10:35 f11777e9 [templates] [I] Rendering template 'Kickstart 
simple'
2016-12-06 13:10:35 f11777e9 [templates] [I] Rendering template 
'centos_7_gentleman_packages'
2016-12-06 13:10:35 f11777e9 [templates] [I] Rendering template 
'kickstart_networking_setup'
2016-12-06 13:10:35 f11777e9 [app] [I]   Rendered inline template (267.1ms)
2016-12-06 13:10:35 f11777e9 [app] [D] Setting current user thread-local 
variable to nil
2016-12-06 13:10:35 f11777e9 [app] [I] Completed 200 OK in 335ms (Views: 
264.3ms | ActiveRecord: 14.2ms)

Only difference as I can see is an order of "Found <hostname>" and "Setting 
current user..." messages. Can It be an issue?

Foreman version is 1.13.2, installed with foreman-installer.

Only one customization from fresh installation is LDAP Authentication. And 
I`m working with LDAP user, who is granted Admin permission via LDAP group.

Please help.

-- 
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.

Reply via email to