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

Make sure that others zabbix repos are absent when zabbix_version is specified #233

Closed kmonticolo closed 5 years ago

kmonticolo commented 5 years ago

Is your feature request related to a problem? Please describe. I realised that I installed the latest agent version using role, while my server uses 3.4 version, so I passed sign_keys: 34 and zabbix_version: 3.4 variables to the role, but it still installs the latest version. I needed to remove /etc/apt/sources.list.d/repo_zabbix_com_zabbix_4_2_ubuntu.list file by hand and run playbook again to fix the problem.

Describe the solution you'd like It will be fine to remove other repo files than just needed to fix the problem and make role more idempotent.

Additional context Add any other context or screenshots about the feature request here.

kobuki commented 5 years ago

I can confirm this is an issue. I had to manually remove all Zabbix repo references from /etc/apt/sources.list.d/ on a Debian system to achieve the required version for the target host.

kmonticolo commented 5 years ago

@kobuki I fixed it in #236 could you please test if it works as expected? Thanks.