I have setup foreman and enabled the auto discovery plugin. When I network boot nodes they appear in the 'Discovered Hosts' group and I can manually provision them.
Is it possible to use the restful API to automatically provision hosts? I had a look through the API and couldn't find any methods, but hopefully I missed something?
My intention is to automatically provision a large group of machines (20-30) and automatically configure them for different roles and start the process, without having to click the provision button for each individual host.
If you're ok with using python you might want to take a look to the
foreman-host-builder script that we're using on top of the python-foreman
wrapper:
Cheers,
Xavier
···
On Wed, Oct 8, 2014 at 8:30 AM, Dave Johnston wrote:
Hi,
I have setup foreman and enabled the auto discovery plugin. When I
network boot nodes they appear in the ‘Discovered Hosts’ group and I can
manually provision them.
Is it possible to use the restful API to automatically provision hosts?
I had a look through the API and couldn’t find any methods, but hopefully I
missed something?
My intention is to automatically provision a large group of machines
(20-30) and automatically configure them for different roles and start the
process, without having to click the provision button for each individual
host.
I think foreman_discovery 1.3 and higher has an API which you could use.
Try hitting /api/v2/discovered_hosts to pull back a list, and then if
you PUT to /api/v2/discovered_hosts/$ID then it should provision it.
There's a list of parameters here:
But in theory it should also show up in /apidoc/ on the server, but it
doesn't seem to work here.
···
On 08/10/14 07:30, Dave Johnston wrote:
> Hi,
>
>
> I have setup foreman and enabled the auto discovery plugin. When I
> network boot nodes they appear in the 'Discovered Hosts' group and I can
> manually provision them.
>
>
> Is it possible to use the restful API to automatically provision hosts?
> I had a look through the API and couldn't find any methods, but
> hopefully I missed something?