def properties_facts(self): ansible_facts = self.to_json(self.host, self.params.get('properties')) if self.params.get('show_tag'): vmware_client = VmwareRestClient(self.module) tag_info = { 'tags': vmware_client.get_tags_for_hostsystem( hostsystem_mid=self.host._moId) } ansible_facts.update(tag_info) self.module.exit_json(changed=False, ansible_facts=ansible_facts)
def all_facts(self): ansible_facts = {} ansible_facts.update(self.get_cpu_facts()) ansible_facts.update(self.get_memory_facts()) ansible_facts.update(self.get_datastore_facts()) ansible_facts.update(self.get_network_facts()) ansible_facts.update(self.get_system_facts()) ansible_facts.update(self.get_vsan_facts()) ansible_facts.update(self.get_cluster_facts()) if self.params.get('show_tag'): vmware_client = VmwareRestClient(self.module) tag_info = { 'tags': vmware_client.get_tags_for_hostsystem(hostsystem_mid=self.host._moId) } ansible_facts.update(tag_info) self.module.exit_json(changed=False, ansible_facts=ansible_facts)