Fix to gather facts include macro and tag (#66947)
This commit is contained in:
parent
e3190adcbb
commit
72e1716f29
1 changed files with 12 additions and 3 deletions
|
@ -125,8 +125,15 @@ class Host(object):
|
|||
search_key = 'search'
|
||||
if exact_match:
|
||||
search_key = 'filter'
|
||||
host_list = self._zapi.host.get({'output': 'extend', 'selectParentTemplates': ['name'], search_key: {'host': [host_name]},
|
||||
'selectInventory': host_inventory, 'selectGroups': 'extend'})
|
||||
host_list = self._zapi.host.get({
|
||||
'output': 'extend',
|
||||
'selectParentTemplates': ['name'],
|
||||
search_key: {'host': [host_name]},
|
||||
'selectInventory': host_inventory,
|
||||
'selectGroups': 'extend',
|
||||
'selectTags': 'extend',
|
||||
'selectMacros': 'extend'
|
||||
})
|
||||
if len(host_list) < 1:
|
||||
self._module.fail_json(msg="Host not found: %s" % host_name)
|
||||
else:
|
||||
|
@ -149,7 +156,9 @@ class Host(object):
|
|||
'selectGroups': 'extend',
|
||||
'selectParentTemplates': ['name'],
|
||||
'hostids': hostinterface['hostid'],
|
||||
'selectInventory': host_inventory
|
||||
'selectInventory': host_inventory,
|
||||
'selectTags': 'extend',
|
||||
'selectMacros': 'extend'
|
||||
})
|
||||
host[0]['hostinterfaces'] = hostinterface
|
||||
host_list.append(host[0])
|
||||
|
|
Loading…
Reference in a new issue