Hi, I am trying to set the default PXELinux template of an OS using Foreman 
APIv2. Here is what I am trying:

curl -v -H "Content-Type: application/json" -X PUT -k -u admin:changeme -d 
@test.json https://192.168.120.10/api/operatingsystems/24

Contents of test.json > 

{
 "operatingsystem": {
 "os_default_templates": [{
 "provisioning_template_id": 87,
 "provisioning_template_name": "Test Kickstart",
 "template_kind_id": 5
 }]
 }
}

Although it returns a Status 200, the template is not set as default. 
Nothing of importance in production.log either:

2017-04-06 23:52:56 ca1bd96c [app] [I] Started PUT 
"/api/operatingsystems/24" for 192.168.120.11 at 2017-04-06 23:52:56 +0530
2017-04-06 23:52:56 ca1bd96c [app] [I] Processing by 
Api::V2::OperatingsystemsController#update as JSON
2017-04-06 23:52:56 ca1bd96c [app] [I]   Parameters: 
{"operatingsystem"=>{"os_default_templates"=>[{"config_template_id"=>87, 
"template_kind_id"=>5}]}, "apiv"=>"v2", "id"=>"24"}
2017-04-06 23:52:56 ca1bd96c [app] [I]   Rendered 
api/v2/operatingsystems/update.json.rabl (44.7ms)
2017-04-06 23:52:56 ca1bd96c [app] [I] Completed 200 OK in 75ms (Views: 
41.2ms | ActiveRecord: 8.2ms)

Using hammer CLI however works fine. Can someone 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