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 249 forks source link

Improving readability and avoiding repeated code #296

Closed santiagomr closed 4 years ago

santiagomr commented 4 years ago

Hi, analyzing the code I noticed that the task "Install the correct repository" in tasks/main.yml is done several times to contemplate each family of operating system and could be reduced to only one (the proposal in this PR). This improves readability and avoids repeating the code of conditionals and tags.

In turn, using include_tasks instead ofinclude makes more intuitive to understand what the role does.

dj-wasabi commented 4 years ago

Thanks! 👍 Interesting, could do this as well with other roles. 👍