foreman-ansible-modules
foreman-ansible-modules copied to clipboard
Import hosts from compute resource
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:
-
Use
resource_info
module to get the uuid, then usehost
module to import host. Document the uuid param in the host module -
Make a new module
host_import
that wraps the above.
ISSUE TYPE
- Feature Idea
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
triage: new module please