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

Make Zabbix repository gpg key URL customizable #1186

Merged
merged 14 commits into from
Mar 7, 2024

Conversation

jtekuelve
Copy link
Contributor

@jtekuelve jtekuelve commented Feb 26, 2024

SUMMARY

The proposed change introduces a variable in the agent, javagateway, proxy, server, and web role, which replaces the hardcoded string in the "Debian | Download gpg key" task. The default value of the "zabbix_repo_deb_gpg_key_url" variable is the previously hardcoded string: http://repo.zabbix.com/zabbix-official-repo.key

Additionally, a second variable "zabbix_repo_deb_include_deb_src" with default value "true" was introduced to toggle adding deb-src in the "Debian | Installing repository {{ ansible_distribution }}" task.

Rationale: We are deploying Zabbix via Ansible in an environment without Internet access. We are using our own package mirror, which is configurable via the "zabbix_repo_deb_url". Unfortunately, without the proposed changes, we are unable to change the download location of the gpg key from the official repo to our own mirror. The second change, making deb-src optional is another change that makes the role easier to use with a custom package mirror. In our testing, it turned out that the deb-src repo was not required. Overall, both changes should not change the current functionality given that only hardcoded parts were replaced by variables with default values.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

roles: zabbix_agent, zabbix_javagateway, zabbix_proxy, zabbix_server, and zabbix_web

ADDITIONAL INFORMATION

I was unsure if I set the variables at the right location (currently defaults/main.yml) of each role. One could also argue to put them in vars/Debian.yml of each role. In the current repo, the defaults already contained some os dependent vars, for example, the # Yum/APT Variables section, therefore I added them there. I am always open to moving or renaming them. For now, I stuck with the naming scheme that prefixes the role name, but it could be confusing since, for example, "zabbix_repo_deb_url" does not stick to this naming scheme and is kind of related.

Copy link
Collaborator

@pyrodie18 pyrodie18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have left this earlier but please update the readme for the roles with the new variables and then you're good to go.

@jtekuelve
Copy link
Contributor Author

After updating the readme I noticed that the other deb repository vars all start with zabbix_repo_deb. I adopted the same prefix for my variables.

changelogs/fragments/1186-custom_gpg_key_url.yml Outdated Show resolved Hide resolved
roles/zabbix_proxy/defaults/main.yml Outdated Show resolved Hide resolved
jtekuelve and others added 2 commits March 7, 2024 10:32
Co-authored-by: Evgeny <ey@bgmot.com>
Co-authored-by: Evgeny <ey@bgmot.com>
@pyrodie18 pyrodie18 merged commit 5f3c13a into ansible-collections:main Mar 7, 2024
274 of 280 checks passed
@BGmot
Copy link
Collaborator

BGmot commented Mar 7, 2024

@pyrodie18 you merged without waiting for test to complete -)))

@pyrodie18
Copy link
Collaborator

It had completed the first time and there were no code significant changes so ya but sorry

@BGmot
Copy link
Collaborator

BGmot commented Mar 7, 2024

No worries -)

pyrodie18 pushed a commit to pyrodie18/community.zabbix that referenced this pull request Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants