Actions
Feature #21989
openAPI Support for Addition/Removal of Config Groups
Description
Currently there's no way to use the API to add or remove config groups to individual hosts, as with individual Puppet classes.
(e.g for Puppetclasses)
curl -s -u $user:$password -H 'Content-Type: application/json' -d '{"puppetclass_id":"'"$puppetclass_id"'"}' -X POST https://$foreman/api/hosts/$server/puppetclass_ids]
To do the equivalent for config groups you need to pull down the current set, and append the new one on the end or, when removing, parse and delete the one you want to get rid of. This is a bit of a pain really.
I understand can always group up classes at a lower level with a single Puppet class to avoid this but would really like this feature in Foreman.
Something like this would be awesome;
curl -s -u admin:password -H 'Content-Type: application/json' -d '{"config_group_ids":"Memcache"}' -X POST https://foreman/api/hosts/server/config_group_ids
Actions