|
|
|
@ -24,6 +24,7 @@ author:
|
|
|
|
|
- Abhijeet Kasurde (@Akasurde)
|
|
|
|
|
notes:
|
|
|
|
|
- Tested on vSphere 6.5
|
|
|
|
|
- If source package name is not available then fact is populated as null.
|
|
|
|
|
requirements:
|
|
|
|
|
- python >= 2.6
|
|
|
|
|
- PyVmomi
|
|
|
|
@ -59,7 +60,36 @@ EXAMPLES = r'''
|
|
|
|
|
register: host_services
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
RETURN = r'''#
|
|
|
|
|
RETURN = r'''
|
|
|
|
|
host_service_facts:
|
|
|
|
|
description:
|
|
|
|
|
- dict with hostname as key and dict with host service config facts
|
|
|
|
|
returned: always
|
|
|
|
|
type: dict
|
|
|
|
|
sample: {
|
|
|
|
|
"10.76.33.226": [
|
|
|
|
|
{
|
|
|
|
|
"key": "DCUI",
|
|
|
|
|
"label": "Direct Console UI",
|
|
|
|
|
"policy": "on",
|
|
|
|
|
"required": false,
|
|
|
|
|
"running": true,
|
|
|
|
|
"uninstallable": false,
|
|
|
|
|
"source_package_name": "esx-base",
|
|
|
|
|
"source_package_desc": "This VIB contains all of the base functionality of vSphere ESXi."
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"key": "TSM",
|
|
|
|
|
"label": "ESXi Shell",
|
|
|
|
|
"policy": "off",
|
|
|
|
|
"required": false,
|
|
|
|
|
"running": false,
|
|
|
|
|
"uninstallable": false,
|
|
|
|
|
"source_package_name": "esx-base",
|
|
|
|
|
"source_package_desc": "This VIB contains all of the base functionality of vSphere ESXi."
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.basic import AnsibleModule
|
|
|
|
@ -89,8 +119,8 @@ class VmwareServiceManager(PyVmomi):
|
|
|
|
|
uninstallable=service.uninstallable,
|
|
|
|
|
running=service.running,
|
|
|
|
|
policy=service.policy,
|
|
|
|
|
source_package_name=service.sourcePackage.sourcePackageName if service.sourcePackage else 'NA',
|
|
|
|
|
source_package_desc=service.sourcePackage.description if service.sourcePackage else 'NA',
|
|
|
|
|
source_package_name=service.sourcePackage.sourcePackageName if service.sourcePackage else None,
|
|
|
|
|
source_package_desc=service.sourcePackage.description if service.sourcePackage else None,
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
hosts_facts[host.name] = host_service_facts
|
|
|
|
|