VMware: New module vmware_guest_vnc (#36282)

This commit is contained in:
Armin Ranjbar Daemi 2018-09-07 12:30:37 +02:00 committed by Abhijeet Kasurde
parent 97fcc3ef66
commit 778b789c84
2 changed files with 252 additions and 0 deletions

View file

@ -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',