Associate a Puppet class (using puppet class name) with a New Host using Foreman API

14 views
Skip to first unread message

Raghava Karthik

unread,
Oct 13, 2014, 8:49:14 AM10/13/14
to puppet...@googlegroups.com


How can i use a puppet class name while creating a host using Foreman API

I used this curl command:


curl -k -u admin:changeme -H "Accept: version=2,application/json" -H "Content-Type: application/json" -k -u admin:changeme -d '{ "host" : { "name" : "test123", "hostgroup_id" : "1", "compute_resource_id" : "3", "compute_profile_name" : "1-Small", "environment_id" : "3", "domain_id" : "1", "mac" : "52:53:00:1e:85:93", "architecture_id" : "1", "operatingsystem_id" : "5", "puppetclasses" : "config" } }' -X POST "$FOREMAN_URL"


above command fails and getting below error.

Error:


{
 "error": {"message":"Puppetclass(#69872206691040) expected, got String(#69872304247800)"}
}


giving "puppetclass_ids" : "5" works in creating a host!
Reply all
Reply to author
Forward
0 new messages