foreman-ansible-modules icon indicating copy to clipboard operation
foreman-ansible-modules copied to clipboard

Import hosts from compute resource

Open nesanton opened this issue 3 years ago • 2 comments

SUMMARY
Use case:

A host is created on VMware by any existing provisioning automation, e.g. using VMware modules or vRealize. Add it as managed or unmanaged host.

Solution:

There is an undocumented parameter uuid in the POST /api/hosts endpoint. This uuid can be taken from the new GET /api/compute_resources/:id/available_virtual_machines endpoint.

Options:
  1. Use resource_info module to get the uuid, then use host module to import host. Document the uuid param in the host module

  2. Make a new module host_import that wraps the above.

ISSUE TYPE
  • Feature Idea

nesanton avatar Nov 11 '20 09:11 nesanton

Now I have it written, I think option 1 makes more sense.

Added the doc request for the uuid in the API https://projects.theforeman.org/issues/31296

nesanton avatar Nov 11 '20 09:11 nesanton

triage: new module please

evgeni avatar Nov 24 '20 16:11 evgeni