My fisrt working draft https://github.com/bcoca/ansible/tree/vsphere_inventory,
test, comment, patch, break, insult … etc
My fisrt working draft https://github.com/bcoca/ansible/tree/vsphere_inventory,
test, comment, patch, break, insult … etc
It at least works to connect to my ESXi server and list all the VMs.
There are no host variables returned (e.g. ansible_ssh_host), so Ansible
wouldn't be able to connect unless the VM name happened to be the same as
the hostname. There is also no indication of VM status to allow connecting
only to running VMs. The --host command line option also doesn't work
(though Ansible will normally use ['_meta']['hostvars'] and never call it
with --host anyways).
I'll be glad to help out in implementing some of these things next week if
you don't get to it before then.