Feature #85


Implement REST or something similar?

Added by Josh Baird about 14 years ago. Updated about 13 years ago.

Host creation
Target version:
Fixed in Releases:
Found in Releases:


It would be useful (at least for me) to be able to add a host to Foreman via a REST call or a similar API. I think this would come in useful for those who aren't using Foreman to handle unattended installations but still use it to manage external nodes and handle reporting. As an example, this would allow one to add a host to Foreman as you are bootstrapping puppet on a new machine.

You would need to be able to pass basic parameters via REST: hostname/IP address, environment, Foreman group, etc.

Do you think this would be possible?

Related issues 1 (0 open1 closed)

Related to Foreman - Feature #45: Enable an API to remove hostsClosedOhad Levy10/12/2009Actions
Actions #1

Updated by Ohad Levy about 14 years ago

Foreman is already restful :)

there are a few other different usage cases where this would make sense - e.g. when I have many new machines to add and i don't want to key in each and every one of them.

it is possible to create new hosts already, you would only need to keep the cookie for authorization,
I'll post an example script in the extra sub directory.

another option for you which might be much easier is to use the host importer from an existing external nodes, this will allow you to create a simple yaml dump and feed it into foreman for new hosts.
see External Nodes

Actions #2

Updated by Ohad Levy almost 14 years ago

  • Category set to Host creation
  • Status changed from New to Resolved
  • Assignee set to Ohad Levy

I've made a simple example of a script which creates hosts at

If I'll have some more time, I'll clean it up and put it in the extra directory.

Actions #3

Updated by Ohad Levy almost 14 years ago

  • Status changed from Resolved to Closed
Actions #4

Updated by Ohad Levy about 13 years ago

Foreman actually use REST interface now, see API for more details


Also available in: Atom PDF