vmware-archive / ansible-module-vcloud-director

ansible-module-vcloud-director
Other
111 stars 86 forks source link

Support VMware Cloud Director for vmware_vm_inventory #160

Open Akasurde opened 3 years ago

Akasurde commented 3 years ago

From @patsevanton on Dec 21, 2020 05:54

SUMMARY

Support VMware Cloud Director for vmware_vm_inventory

ISSUE TYPE

Hello! Thanks for community.vmware.

ansible --version

ansible 2.9.16
  config file = /home/user/sdp-cloud-control/devops/customization/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.6/site-packages/ansible
  executable location = /home/user/.local/bin/ansible
  python version = 3.6.9 (default, Oct  8 2020, 12:12:24) [GCC 8.4.0]

Vmware

VMware Cloud Director version: 10.2.0.17008054 Thu Oct 08 23:53:08 MSK 2020

I try get inventory for ansible from VMware Cloud Director

ansible-inventory --list -i vmware.yaml

Error:

[WARNING]:  * Failed to parse /home/user/sdp-cloud-control/devops/customization/vmware.yaml with vmware_vm_inventory plugin: Unknown error while connecting to vCenter or ESXi API at xxxxx:443 :
xxxxxxx:443 is not a VIM server
[WARNING]: Unable to parse /home/user/sdp-cloud-control/devops/customization/vmware.yaml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
    "_meta": {
        "hostvars": {}
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    }
}

Copied from original issue: ansible/ansible#585

Akasurde commented 3 years ago

From @Akasurde on Dec 22, 2020 05:21

@patsevanton Thanks for the feature idea. vCloud Director is managed by https://github.com/vmware/ansible-module-vcloud-director repo. I think this is the correct location for this feature.

Akasurde commented 3 years ago

Migrated issue.

mukultaneja commented 3 years ago

@Akasurde, Could you please elaborate more on the inventory for example, what kind of information you are looking for as inventory here?

patsevanton commented 3 years ago

Hello! I try get name and ip virtual machine from vmware vcloud for use in ansible inventory.

mukultaneja commented 3 years ago

Hello @patsevanton, I am sorry for the delayed response. I was looking into the query and would like to check if the existing functionality would work for you. This functionality already gives us the list of VMs and IPs created inside a vApp. We also have a sample play that would return all the VMs and IPs present in a vApp. Please take a look at it once and let me know if it works for you.

patsevanton commented 3 years ago

Hello @mukultaneja. I dont use ansible-module-vcloud-director. I use terraform + ansible. My first issue was https://github.com/ansible-collections/community.vmware/issues/585#event-4138623635