dj-wasabi / ansible-zabbix-agent

Installing and maintaining zabbix-agent for RedHat/Debian/Ubuntu/Windows/Suse.
https://galaxy.ansible.com/dj-wasabi/zabbix-agent
MIT License
327 stars 248 forks source link

Avoid conflicts with the zabbix_version and zabbix_url variables #303

Closed santiagomr closed 4 years ago

santiagomr commented 4 years ago

Feature Pull Request

Hello again,

currently the version of the Zabbix Agent to be installed is indicated by a variable (zabbix_version) that has the same name in this role, in zabbix-server and in zabbix-web.

This generates some collisions when all roles are used on the same host or group of hosts (the most frequently used case) and makes it impossible to have different agent and server versions (it is necessary in some cases).

This pull request is a solution to this problem, while maintaining backward compatibility with the current variable structure. It's simply proposed to use a new variable, zabbix_agent_version, to indicate the version of the agent to be installed and use this variable as a "bypass" for the variable used by the role:

zabbix_agent_version: 4.4
zabbix_version: "{{ zabbix_agent_version }}"

Identical reasoning is applied to the variable zabbix_url, which can also result in conflicts with the other Zabbix roles

zabbix_agent_server_url: "http://zabbix.dj-wasabi.local"
zabbix_url: "{{ zabbix_agent_server_url }}"

Naturally, to maintain consistency throughout the role kit, the same "bypass" must be performed on zabbix-server and zabbix-web. This pull request is accompanied by two others that I am sending you in minutes.

dj-wasabi commented 4 years ago

Hi @santiagomr

Thank you, and when I read this PR it makes sense (At first I was why?, but this make it clear). One small thing and is basically for all 3 PR's, can you also update the README.md, so it is also clear for other people?

Thanks! 👍

Kind regards, Werner

santiagomr commented 4 years ago

It's good that the description was understandable.

I already added the README.md update to the 3 PR's.

Thanks to you

dj-wasabi commented 4 years ago

Thanks! 👍