Nutanix dynamic inventory script for Ansible


Badge +1
Hello,

I've just released a Nutanix dynamic inventory script for Ansible, and I thought I'd share it here for anyone who might find it useful: https://github.com/mattkeeler/ansible-nutanix-inventory

It's able to generate an inventory from multiple clusters, and you can list VMs by name or IP address.

Questions, comments, and contributions are more than welcome.

7 replies

Userlevel 7
Badge +35
Thanks for sharing keeler - great work.
Userlevel 1
Badge +13
thanks for sharing
Userlevel 1
Badge +13
@keeler has there been any further progress around what was discussed in the pull request https://github.com/ansible/ansible/pull/21972 ?

Thanks
Badge +1
@seaton I haven't heard anything else from @Jon.
Userlevel 1
Badge +13
@keeler offer still stands if you want help with ansible module
Badge +1
@seaton I'm happy to take pull requests if you want to add functionality for the v2 API. It would be pretty easy to add a command line flag like --api that switches between API versions.
@keeler

When I run "ansible hosts -i nutanix.py -m ping" I get the following Error..

[warning]: * Failed to parse /Path/to/file/nutanix.py with script
plugin: failed to parse executable inventory script results from
/Path/to/file/nutanix.py: Syntax Error while loading YAML. found
unexpected ':' The error appears to have been in '': line 1, column 1873,
but may be elsewhere in the file depending on the exact syntax problem.

I removed the file location for obvious reasons.

Any help would be greatly appreciated.

Also.. When I run the script "--pretty" "--names" "--list" , the script comes back without issues.

Reply