ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
321 stars 280 forks source link

Import Zabbix 5.4 - 6.0 Template format YAML #618

Open smejdil opened 2 years ago

smejdil commented 2 years ago

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

D3DeFi commented 2 years ago

thanks for opening this issue, definitely a good tip

dutrajulio commented 2 years ago

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

heyzling commented 9 months ago

"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