Closed wsslhllmn closed 8 months ago
I have the same issue here.
I have a old ansible instalation, that works yet. But with a new version (python 3.11), my problem is the same registered by wsslhllmn
wsslhllmn, I can solve the issue, following this : https://github.com/ansible-collections/community.vmware/pull/1919
I installed the version 4.0.1 by git (not by ansible-galaxy)
Good luck
I'm pretty sure this has been fixed in 4.0.1.
Please re-open this issue (or open a new one) if I'm wrong there.
SUMMARY
When using the vmware_vm_info module, to retrieve all virtual machines in a cluster, the tasks fails. This code works for collection version 3.9.0 but not for 4.0.0.
ISSUE TYPE
COMPONENT NAME
vmware_vm_info
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
The execution environment is based on: LABEL com.redhat.component="ubi8-minimal-container" name="ubi8-minimal" version="8.8"
bash-4.4# cat /etc/redhat-release Red Hat Enterprise Linux release 8.8 (Ootpa)
STEPS TO REPRODUCE
When using the vmware_vm_info module, to retrieve all virtual machines in a cluster, we receive the error below:
"Traceback (most recent call last):\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 107, in\n _ansiballz_main()\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_vm_info', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_vm_info', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 475, in \n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 469, in main\n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 355, in get_virtual_machines\nAttributeError: 'NoneType' object has no attribute 'ipAddress'\n",
EXPECTED RESULTS
We expect data of all virtual machines within the cluster.
ACTUAL RESULTS
"Traceback (most recent call last):\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 107, in\n _ansiballz_main()\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/runner/.ansible/tmp/ansible-tmp-1702897038.9956489-28-276243937352167/AnsiballZ_vmware_vm_info.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.vmware.plugins.modules.vmware_vm_info', init_globals=dict(_module_fqn='ansible_collections.community.vmware.plugins.modules.vmware_vm_info', _modlib_path=modlib_path),\n File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 475, in \n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 469, in main\n File \"/tmp/ansible_community.vmware.vmware_vm_info_payload_4dn07e96/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_vm_info.py\", line 355, in get_virtual_machines\nAttributeError: 'NoneType' object has no attribute 'ipAddress'\n",