ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 335 forks source link

vmware inventory pluging not functioning #1146

Open coreydeli opened 2 years ago

coreydeli commented 2 years ago
SUMMARY

When running an inventory in Ansible in AWX 19.5.0 you recieve an error not allowing you to go forward and pull the inventory

ISSUE TYPE
COMPONENT NAME

community.vmware.vmware_vm_inventory

ANSIBLE VERSION

AWX 19.5.0

COLLECTION VERSION

1.17

STEPS TO REPRODUCE

Run any inventory sync

EXPECTED RESULTS

Inventory populates

ACTUAL RESULTS

Met with an inventory error

ansible-inventory [core 2.11.7.post0] 
  config file = None
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/runner/.ansible/collections:/usr/share/ansible/collections:/usr/share/automation-controller/collections
  executable location = /usr/local/bin/ansible-inventory
  python version = 3.8.8 (default, Aug 25 2021, 16:13:02) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
  jinja version = 2.10.3
  libyaml = True
No config file found; using defaults
redirecting (type: inventory) ansible.builtin.vmware_vm_inventory to community.vmware.vmware_vm_inventory
[WARNING]:  * Failed to parse /runner/inventory/vmware_vm_inventory.yml with
auto plugin: Unknown error while connecting to vCenter or ESXi API at vsphereserver.my.domain.com:443 : [Errno -2] Name or service not known
  File "/usr/local/lib/python3.8/site-packages/ansible/inventory/manager.py", line 290, in parse_source
    plugin.parse(self._inventory, self._loader, source, cache=cache)
  File "/usr/local/lib/python3.8/site-packages/ansible/plugins/inventory/auto.py", line 58, in parse
    plugin.parse(inventory, loader, path, cache=cache)
  File "/usr/share/ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 644, in parse
    self.pyv.do_login()
  File "/usr/share/ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 401, in do_login
    self.si, self.content = self._login()
  File "/usr/share/ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 443, in _login
    return connect_to_api(module=None, disconnect_atexit=True, return_si=True,
  File "/usr/share/ansible/collections/ansible_collections/community/vmware/plugins/module_utils/vmware.py", line 773, in connect_to_api
    _raise_or_fail(msg="%s : %s" % (msg, generic_exc))
  File "/usr/share/ansible/collections/ansible_collections/community/vmware/plugins/module_utils/vmware.py", line 707, in _raise_or_fail
    raise ApiAccessError(msg)
[WARNING]: Unable to parse /runner/inventory/vmware_vm_inventory.yml as an
inventory source
ERROR! No inventory was parsed, please check your configuration and options.
Akasurde commented 2 years ago

@Iwifia Thanks for reporting this issue. Please see this error

Unknown error while connecting to vCenter or ESXi API at vsphereserver.my.domain.com:443 : [Errno -2] Name or service not known

Could you please check if vsphereserver.my.domain.com is reachable?