diff --git a/changelogs/fragments/vmware_portgroup_list_host.yml b/changelogs/fragments/vmware_portgroup_list_host.yml new file mode 100644 index 00000000000..2bb480d35bb --- /dev/null +++ b/changelogs/fragments/vmware_portgroup_list_host.yml @@ -0,0 +1,2 @@ +minor_changes: +- vmware_portgroup accepts list of ESXi hostsystem. Modified get_all_host_objs API to accept list of hostsystems. diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index 3d6a63b7e49..5722b772791 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -1109,7 +1109,7 @@ class PyVmomi(object): for host in esxi_host_name: esxi_host_obj = self.find_hostsystem_by_name(host_name=host) if esxi_host_obj: - host_obj_list = [esxi_host_obj] + host_obj_list.append(esxi_host_obj) else: self.module.fail_json(changed=False, msg="ESXi '%s' not found" % host)