Open
Description
Describe the bug
Using vmware.alb.avi_vcenterserver (version 22.1.7 or 30.2.2) to create a vcenterserver for addint to a nsx-t cloud failes in a "list index out of range" error.
Reproduction steps
- define the vars for a nsx-t cloud and for a vcenterserver
- name: Create vcenter
vmware.alb.avi_vcenterserver:
avi_credentials: "{{ avi_credentials }}"
name: vcentera
vcenter_url: vcenter.local.domain
vcenter_credentials_ref: MYCRED
content_lib:
id: <uuid>
cloud_ref: NAMEOFNSXTCLOUD
- deploy it
- it failes with list index out of range error
Expected behavior
vcenter gets created and linked to cloud
Additional context
Issue seems to be in file vmware/alb/plugins/module_utils/utils/ansible_utils.py, line 485 (30.2.2) or line 479 (22.1.7). Changing
#cloud = obj['cloud_ref'].split('name=')[1]
to
cloud = obj['cloud_ref']
fixes it in a quick and dirty way as we now have to use the uuid instead of the name.