Since I was looking for this quite hard, and since I had to investigate it,
here is an example of how to use curl to set the default templates for a
specific operating system, under Foreman 1.3.2.
A little explanation: I set template of type 1 (pxe boot template) to
template ID 1, and set template type 3 (kickstart template) to template id
5. This is performed for operating system id 1. Also - I am using the
default admin:changeme login details.
curl -k -u admin:changeme -H "Content-Type:application/json" -H
"Accept:application/json,version=2" -X PUT -d
'{"operatingsystem":{"id":"1","os_default_templates_attributes":{"0":{"template_kind_id":"1","config_template_id":"1"},"1":{"template_kind_id":"3","config_template_id":"5"}}}}'
https://foreman.mgmt/api/operatingsystems/1 | prettify_json.rb
Just for eternity
Etzion