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

RHEL9 zabbix-agent package upgrade fails when installed with community.zabbix.zabbix_agent #1294

Open
juresaht2 opened this issue Jun 14, 2024 · 2 comments
Labels
enhancement New feature or request role The issue or pull request is related to Zabbix role

Comments

@juresaht2
Copy link
Contributor

SUMMARY

When installing zabbix-agent using the community.zabbix.zabbix_agent role, subsequent upgrades on the OS using dnf upgrade fail, because of this bug:
https://support.zabbix.com/si/jira.issueviews:issue-html/ZBX-21363/ZBX-21363.html

In the bug the suggested solution is an alteration of the install procedure which this role should use:

As a workaround, we can exclude zabbix packages from epel.repo:

[epel]
...
excludepkgs=zabbix*
ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.zabbix.zabbix_agent

ANSIBLE VERSION
ansible [core 2.16.2]
  config file = /home/user/dev-jsah/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.5 (main, Oct 25 2023, 14:45:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-21)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
CONFIGURATION
CONFIG_FILE() = /home/user/dev-jsah/ansible.cfg
DEFAULT_NO_LOG(/home/user/dev-jsah/ansible.cfg) = False
DEFAULT_ROLES_PATH(/home/user/dev-jsah/ansible.cfg) = ['/home/user/dev-jsah/roles', '/usr/share/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/user/dev-jsah/ansible.cfg) = yaml
HOST_KEY_CHECKING(/home/user/dev-jsah/ansible.cfg) = False
OS / ENVIRONMENT / Zabbix Version

Target OS: Rocky Linux release 9.4 (Blue Onyx)

STEPS TO REPRODUCE
- name: "Run zabbix-agent role from collection"
  include_role: 
    name: "community.zabbix.zabbix_agent"
  tags: always

...afterwards:

    - name: Host - update
      package:
        name: "*"
        state: latest
EXPECTED RESULTS

OS upgraded without issue.

ACTUAL RESULTS
fatal: [r9.test]: FAILED! => changed=false 
  failures: []
  msg: |-
    Unknown Error occurred: Transaction test error:
      file /usr/bin/zabbix_sender from install of zabbix-1:6.0.30-1.el9.x86_64 conflicts with file from package zabbix-sender-6.4.15-release1.el9.x86_64
      file /usr/bin/zabbix_get from install of zabbix-1:6.0.30-1.el9.x86_64 conflicts with file from package zabbix-get-6.4.15-release1.el9.x86_64
  rc: 1
  results: []
@pyrodie18 pyrodie18 added enhancement New feature or request role The issue or pull request is related to Zabbix role labels Jun 19, 2024
@pyrodie18
Copy link
Collaborator

So trying to figure out how to do this and can't think of a clean way to. I would use the yum_repo module to do it, but you need to feed it the URL for the install. Trying to think of a good way to get that so I don't overwrite a custom URL. The other thing we could do is lineinfile but by default there's several repos in the epel.repo file and I can't think of a good way to make sure it goes in the correct block.

@juresaht2
Copy link
Contributor Author

I think the official recommendation is to use ini_file to edit the repository file.

Example: ansible/ansible-modules-extras#2384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request role The issue or pull request is related to Zabbix role
Projects
None yet
Development

No branches or pull requests

2 participants