I am trying to leverage Foreman API v2 to create hosts but I can’t find good examples on how to provide override values for Puppet Class Parameters. Can anyone give me a few examples on how I can accomplish this?
Hi,
here is an example that should work:
[ INFO 2020-02-04T09:15:27 API] POST /api/smart_class_parameters/1393/override_values
[DEBUG 2020-02-04T09:15:27 API] Params: {
"override_value" => {
"match" => "fqdn=host.example.com",
"value" => "true"
}
}
I have extracted this from the output of hammer -d sc-param add-matcher ....
. Using hammer -d can help a lot when trying to figure out how to use the API, since it prints out all the API calls including the JSON data.
Hope this helps
Regards