mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add find_vm_by_name function to vmware utils
This commit is contained in:
parent
b72cd3a6d2
commit
3a1944edc1
1 changed files with 9 additions and 0 deletions
|
@ -99,6 +99,15 @@ def find_hostsystem_by_name(content, hostname):
|
|||
return None
|
||||
|
||||
|
||||
def find_vm_by_name(content, vm_name):
|
||||
|
||||
vms = get_all_objs(content, [vim.VirtualMachine])
|
||||
for vm in vms:
|
||||
if vm.name == vm_name:
|
||||
return vm
|
||||
return None
|
||||
|
||||
|
||||
def vmware_argument_spec():
|
||||
|
||||
return dict(
|
||||
|
|
Loading…
Reference in a new issue