community.zabbix icon indicating copy to clipboard operation
community.zabbix copied to clipboard

Import Zabbix 5.4 - 6.0 Template format YAML

Open smejdil opened this issue 3 years ago • 3 comments

Deafult templates in Zabbix 5.4 and 6.0 are in YAML format. For automated import of templates this format is needed. (XML and JSON is ready)

SUMMARY

Add parametr template_yaml

COMPONENT NAME

Modules: zabbix_template

smejdil avatar Jan 26 '22 12:01 smejdil

thanks for opening this issue, definitely a good tip

D3DeFi avatar Jan 27 '22 18:01 D3DeFi

As a temporary workaround you can use the "from_yaml" Ansible filter.

dutrajulio avatar May 31 '22 14:05 dutrajulio

"from_yaml" workaround example.

- name: Import Zabbix template from Ansible dict variable
  community.zabbix.zabbix_template:
    template_json: "{{ lookup('file', 'my-template.yaml') | from_yaml }}"
    state: present

heyzling avatar Dec 18 '23 21:12 heyzling