community / community.zabbix / 1.8.0 / module / zabbix_host_info Gather information about Zabbix host Authors: Michael Miko (@RedWhiteMiko)community.zabbix.zabbix_host_info (1.8.0) — module
Install with ansible-galaxy collection install community.zabbix:==1.8.0
collections: - name: community.zabbix version: 1.8.0
This module allows you to search for Zabbix host entries.
This module was called C(zabbix_host_facts) before Ansible 2.9. The usage did not change.
- name: Get host info local_action: module: community.zabbix.zabbix_host_info server_url: http://monitor.example.com login_user: username login_password: password host_name: ExampleHost host_ip: 127.0.0.1 timeout: 10 exact_match: no remove_duplicate: yes
- name: Reduce host inventory information to provided keys local_action: module: community.zabbix.zabbix_host_info server_url: http://monitor.example.com login_user: username login_password: password host_name: ExampleHost host_inventory: - os - tag host_ip: 127.0.0.1 timeout: 10 exact_match: no remove_duplicate: yes
host_ip: description: - Host interface IP of the host in Zabbix. - Required when I(host_name) is not used. elements: str required: false type: list timeout: default: 10 description: - The timeout of API request (seconds). type: int host_name: description: - Name of the host in Zabbix. - host_name is the unique identifier used and cannot be updated using this module. - Required when I(host_ip) is not used. required: false type: str login_user: description: - Zabbix user name. - If not set the environment variable C(ZABBIX_USERNAME) will be used. required: true type: str server_url: aliases: - url description: - URL of Zabbix server, with protocol (http or https). C(url) is an alias for C(server_url). - If not set the environment variable C(ZABBIX_SERVER) will be used. required: true type: str exact_match: default: false description: - Find the exact match type: bool host_inventory: description: - List of host inventory keys to display in result. - Whole host inventory is retrieved if keys are not specified. elements: str required: false type: list login_password: description: - Zabbix user password. - If not set the environment variable C(ZABBIX_PASSWORD) will be used. required: true type: str validate_certs: default: true description: - If set to False, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. - If not set the environment variable C(ZABBIX_VALIDATE_CERTS) will be used. type: bool http_login_user: description: - Basic Auth login type: str remove_duplicate: default: true description: - Remove duplicate host from host result type: bool http_login_password: description: - Basic Auth password type: str
hosts: description: List of Zabbix hosts. See https://www.zabbix.com/documentation/4.0/manual/api/reference/host/get for list of host values. returned: success sample: - '...': null available: '1' description: '' disable_until: '0' error: '' flags: '0' groups: - '1' host: Host A type: dict