ansible-collections / community.zabbix

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

Put zabbix_repo_deb_url in defaults #1225

Closed eb4x closed 1 month ago

eb4x commented 1 month ago
SUMMARY

Instead of having a partial url in vars/Debian.yml, and appending to it with additional info via set_fact, if zabbix_repo_deb_url is not defined. Just supply it as a default, which could be overriden by user.

Zabbix also supplies an ubuntu-arm64 repo, so now we check for that aswell.

Notes on Raspbian There are very few ways do differentiate Raspbian from Debian with ansible_facts. The only candidate seems to be ansible_facts.lsb.id.

The lsb section does not get filled in unless some packages are installed. But luckily those packages come installed on Raspbian systems. And we just default it back to ansible_facts.distribution if lsb.id is not present. So we're gonna simplify and drop some tasks.

Tested with ansible-core 2.13.13 on;

2024-03-12-raspios-bullseye-armhf-lite 2024-03-15-raspios-bookworm-armhf-lite

If this for some unforseen reason wouldn't work on older or newer versions of raspbian, there's always the option of just overriding the zabbix_repo_deb_url.

ISSUE TYPE
COMPONENT NAME

All the roles.

ADDITIONAL INFORMATION

Discussed at great length in https://github.com/ansible-collections/community.zabbix/pull/1196#discussion_r1594417835

Addresses the concerns of #1219