community / community.zabbix / 0.2.0 / module / zabbix_template_info Gather information about Zabbix template Authors: sky-joker (@sky-joker)community.zabbix.zabbix_template_info (0.2.0) — module
Install with ansible-galaxy collection install community.zabbix:==0.2.0
collections: - name: community.zabbix version: 0.2.0
This module allows you to search for Zabbix template.
- name: Get Zabbix template as JSON zabbix_template_info: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret template_name: Template format: json omit_date: yes register: template_json
- name: Get Zabbix template as XML zabbix_template_info: server_url: "http://zabbix.example.com/zabbix/" login_user: admin login_password: secret template_name: Template format: xml omit_date: no register: template_json
format: choices: - json - xml default: json description: - Format to use when dumping template. type: str timeout: default: 10 description: - The timeout of API request (seconds). type: int omit_date: default: false description: - Removes the date field for the dumped template required: false type: bool login_user: description: - Zabbix user name. 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). required: true type: str template_name: description: - Name of the template in Zabbix. required: true type: str login_password: description: - Zabbix user password. 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. type: bool http_login_user: description: - Basic Auth login type: str http_login_password: description: - Basic Auth password type: str
template_json: description: The JSON of the template returned: when format is json and omit_date is true sample: zabbix_export: groups: - name: Templates templates: - applications: - name: Test Application description: Testing template import discovery_rules: [] groups: - name: Templates httptests: [] items: [] macros: [] name: Template for Testing screens: [] template: Test Template templates: [] version: '4.0' type: str template_xml: description: The XML of the template returned: when format is xml and omit_date is false sample: "<zabbix_export>\n <version>4.0</version>\n <date>2019-10-27T14:49:57Z</date>\n\ \ <groups>\n <group>\n <name>Templates</name>\n </group>\n\ \ </groups>\n <templates>\n <template>\n <template>Test\ \ Template</template>\n <name>Template for Testing</name>\n \ \ <description>Testing template import</description>\n <groups>\n\ \ <group>\n <name>Templates</name>\n \ \ </group>\n </groups>\n <applications>\n \ \ <application>\n <name>Test Application</name>\n\ \ </application>\n </applications>\n <items\ \ />\n <discovery_rules />\n <httptests />\n \ \ <macros />\n <templates />\n <screens />\n </template>\n\ \ </templates>\n</zabbix_export>" type: str