foreman_nutanix
Foreman plugin to create compute resource and (de)provision hosts using Nutanix.
NOTE: This is a WIP and will not be shocking to find broken features, dead code, and probably not the best Ruby coding you've ever seen.
Install
The project layout includes a Python 'shim server'. This is because the official SDKs by Nutanix do not include Ruby, and re-implementing an SDK wasn't appealing. It should make it easier to upgrade/change between Nutanix versions.
Shim Server
Requires these env vars set:
export NUTANIX_API_KEY=...someApiKey...
export NUTANIX_HOST=..some.host.com...
# All others are optional and can be found with:
nutanix-shim-server --helpFrom PyPI
https://pypi.org/project/nutanix-shim-server/
pip install nutanix-shim-server
nutanix-shim-server --port 8000
From source
Assuming you can use uv, it'll look something like this:
uv pip install .
uv run nutanix-shim-server --port 8000Serving with https
By default, using nutanix-shim-server will use the production server of fastapi and all (if any)
additional options will be supplied to fastapi.
If you want SSL/https, then supply --ssl-certfile and --ssl-keyfile, it will then
use uvicorn with https, all following options will be supplied to uvicorn instead.
See available help and possible environment variables with
nutanix-shim-server --help
Foreman Plugin
Requires this env var set:
export NUTANIX_SHIM_SERVER_ADDR=https://nutanix-shim-server-addrFrom Ruby Gems
https://rubygems.org/gems/foreman_nutanix
gem 'foreman_nutanix'From Source
# Gemfile
gem 'foreman_nutanix', :path => '/path/to/repo/foreman_nutanix/foreman_nutanix'