diff --git a/changelogs/fragments/66026-zabbix_host_info.yml b/changelogs/fragments/66026-zabbix_host_info.yml new file mode 100644 index 00000000000..ccd5014dcff --- /dev/null +++ b/changelogs/fragments/66026-zabbix_host_info.yml @@ -0,0 +1,2 @@ +minor_changes: + - zabbix_host_info - ``host_name`` based search results now include host groups. diff --git a/lib/ansible/modules/monitoring/zabbix/zabbix_host_info.py b/lib/ansible/modules/monitoring/zabbix/zabbix_host_info.py index 86d6756292d..a43c1036572 100644 --- a/lib/ansible/modules/monitoring/zabbix/zabbix_host_info.py +++ b/lib/ansible/modules/monitoring/zabbix/zabbix_host_info.py @@ -120,7 +120,7 @@ class Host(object): if exact_match: search_key = 'filter' host_list = self._zapi.host.get({'output': 'extend', 'selectParentTemplates': ['name'], search_key: {'host': [host_name]}, - 'selectInventory': host_inventory}) + 'selectInventory': host_inventory, 'selectGroups': 'extend'}) if len(host_list) < 1: self._module.fail_json(msg="Host not found: %s" % host_name) else: