Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community.zabbix.zabbix_host: Add possebility to import yaml host deffinitions #1317

Open
sonor3000 opened this issue Jul 1, 2024 · 0 comments
Labels
enhancement New feature or request module The issue or pull request is related to Zabbix module

Comments

@sonor3000
Copy link

SUMMARY

Please add the possebility to import a yaml host definition for the community.zabbix.zabbix_host plugin like it is already there for the community.zabbix.zabbix_template plugin with the template_yaml parameter.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

community.zabbix.zabbix_template

ADDITIONAL INFORMATION

Withh the community.zabbix.zabbix_template plugin I can create or update templates easily with ansible using the same yaml structure that also Zabbix is able to handle. I can handle those files in git and update templates for different Zabbix instances which is the perfect GitOps aproach to maintain our Zabbix test and prod instance and have all monitoring data also as code in a way also Zabbix is able to understand natively. Changes to a template only means changing the yaml, commit it to the git and run a playbook that updates the template using the template_yaml parameter to import the new or changed template.

I'd like to do the same for all our hosts configured in Zabbix. but unfortunatly it is not possible to import the original yaml definition of a host which was exported as yaml from Zabbix before into another Zabbix instance using the host plugin for ansible. I have to maintain a paralel yaml structure for my hosts in a way that the ansible host plugin can process, but using the yaml structure that would Zabbix create during exporting a host can't be used with the host plugin allthough this would be much more easy and also much mor comfortable.

So having a parameter like the template_yaml thing for the template plugin would be very cool also for the host module / plugin.

Or am I going the totaly wrong way and should I handle my host configurations another way?

My idea is to store the configuration of every host that I want to have in Zabbix in the same format I'd get if I have created the host via the Zabbix GUI and exported it as yaml. If I like to change a host I'd change the yaml, commit it to a git and run a playbook that loops via the host yaml files and performs the changes to the hosts via the Zabbix API. That works perfectly fine for templates, but for hosts I am not able to work this way. Instead I have to configure the hosts in the way that it is fine for the ansible host plugin which is totaly different yaml like I get if I export the same host from Zabbix.

How do you handle your different host definitions in ansible? Is it the wrong approach to use the yaml structure that Zabbix does understand or is it even the wrong approach to handle the hosts I want to configure in Zabbix wit or in ansible? How can I geta GitOps like configuration not only for templates but also for hosts? Or am I able to use the Zabbix yaml structure with the community.zabbix.zabbix_host plugin somehow in my playbooks?

@sonor3000 sonor3000 changed the title community.zabbix.zabbix_host: Add possebility to import yaml host deffinitons community.zabbix.zabbix_host: Add possebility to import yaml host deffinitions Jul 1, 2024
@pyrodie18 pyrodie18 added enhancement New feature or request module The issue or pull request is related to Zabbix module labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request module The issue or pull request is related to Zabbix module
Projects
None yet
Development

No branches or pull requests

2 participants