mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-04 15:29:10 -07:00
VMware: New module vmware_guest_vnc (#36282)
This commit is contained in:
parent
97fcc3ef66
commit
778b789c84
2 changed files with 252 additions and 0 deletions
|
@ -295,6 +295,7 @@ def gather_vm_facts(content, vm):
|
|||
'customvalues': {},
|
||||
'snapshots': [],
|
||||
'current_snapshot': None,
|
||||
'vnc': {},
|
||||
}
|
||||
|
||||
# facts that may or may not exist
|
||||
|
@ -398,6 +399,8 @@ def gather_vm_facts(content, vm):
|
|||
if 'snapshots' in snapshot_facts:
|
||||
facts['snapshots'] = snapshot_facts['snapshots']
|
||||
facts['current_snapshot'] = snapshot_facts['current_snapshot']
|
||||
|
||||
facts['vnc'] = get_vnc_extraconfig(vm)
|
||||
return facts
|
||||
|
||||
|
||||
|
@ -444,6 +447,15 @@ def list_snapshots(vm):
|
|||
return result
|
||||
|
||||
|
||||
def get_vnc_extraconfig(vm):
|
||||
result = {}
|
||||
for opts in vm.config.extraConfig:
|
||||
for optkeyname in ['enabled', 'ip', 'port', 'password']:
|
||||
if opts.key.lower() == "remotedisplay.vnc." + optkeyname:
|
||||
result[optkeyname] = opts.value
|
||||
return result
|
||||
|
||||
|
||||
def vmware_argument_spec():
|
||||
return dict(
|
||||
hostname=dict(type='str',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue