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

Role cannot install Zabbix web 5.0 on RHEL 7 #202

Closed
tux-o-matic opened this issue Aug 20, 2020 · 13 comments · Fixed by #266
Closed

Role cannot install Zabbix web 5.0 on RHEL 7 #202

tux-o-matic opened this issue Aug 20, 2020 · 13 comments · Fixed by #266
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@tux-o-matic
Copy link
Contributor

SUMMARY

Despite using the name "RedHat", the zabbix_web role can only install on CentOS, not RHEL 7 (EL 8 is another story).
This is due to the reliance on the CentOS SCL which in RHEL doesn't exist.
The CentOS SCL project documents the alternative for RHEL on their GitHub.

Also, note that the documented default and actual default value do not match for the parameter * zabbix_web_centos_release*.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

Zabbix_web

ANSIBLE VERSION
ansible 2.9.9
CONFIGURATION
DISPLAY_SKIPPED_HOSTS(/Users/bmt/git/ansible-zabbix/ansible.cfg) = False
OS / ENVIRONMENT / Zabbix Version

Red Hat Enterprise Linux 7

STEPS TO REPRODUCE

Try to deploy zabbix_web on RHEL 7.

EXPECTED RESULTS

The role should set the right Yum repo on RHEL 7 to install the web and PHP rpm needed by Zabbix 5.0.

ACTUAL RESULTS
FAILED! => {"attempts": 3, "changed": false, "msg": "No package matching 'centos-release-scl' found available, installed or updated", "rc": 126, "results": ["No package matching 'centos-release-scl' found available, installed or updated"]}
@dj-wasabi dj-wasabi self-assigned this Aug 20, 2020
@dj-wasabi dj-wasabi added the bug Something isn't working label Aug 20, 2020
@dj-wasabi
Copy link
Contributor

Hi @tux-o-matic

What does {{ ansible_distribution }} show in a RHEL environment, just RedHat?

@tux-o-matic
Copy link
Contributor Author

Indeed, the ansible_distribution fact will return RedHat on RHEL. At don't have a CentOS at hand but an internet search would say that ansible_distribution would return CentOS on one. But then they share the same value for ansible_os_family.

@dj-wasabi
Copy link
Contributor

Hi @tux-o-matic

Yes, with CentOS it does provide CentOS. But in the RedHat.yml some tasks can be added that only will be executed with when: ansible_distribution == "RedHat" so that it will be executed on the actually RedHat instances.

@tux-o-matic
Copy link
Contributor Author

In regards to the handling of SCL, tasks will have to be slightly different/split between CentOS and RHEL.
RHEL needs to have its rhel-server-rhscl-7-rpmsrepo enabled instead.

@dj-wasabi
Copy link
Contributor

Hi @tux-o-matic

I created a PR, are you able to test this and let me know how it works?
Thanks in advance.

Kind regards,
Werner

@tux-o-matic
Copy link
Contributor Author

Any easy way to test your PR @dj-wasabi ?

collections:
  - name: community.zabbix
    scm: git
    src: https://github.com/dj-wasabi/community.zabbix
    version: install-rhel-repo

Is not working to download your patch.

@dj-wasabi
Copy link
Contributor

And if you do a git clone and checkout to the branch on command line instead of doing a requirements file?

@tux-o-matic
Copy link
Contributor Author

Thanks @dj-wasabi , that way works to test.
But made me notice:

when:
     - zabbix_repo == "zabbix"

That's too restrictive, the SCL is needed on RHEL 7 for PHP 7.2 regardless of the repo used to fetch Zabbix packages.

@dj-wasabi
Copy link
Contributor

I have removed it and pushed it.

@tux-o-matic
Copy link
Contributor Author

So it's not right, I can confirm my earlier claim: you need to have the "rhel-server-rhscl-7-rpms" repo enable don RHEL7.
Either enabling it in /etc/yum.repos.d/redhat.repoor using subscription-manager

@dj-wasabi
Copy link
Contributor

Oh? But you provided a link to a Github repository and use that repo. The roles in this collection should only maintain their own repository files and not change other repository files, as this would increase confusion and destroy idempotence. So unless you have other ideas, then this would result in closing the issue.

@tux-o-matic
Copy link
Contributor Author

idempotence, no... as long as subsequent Ansible run do not duplicate a previously applied change.
By installing the CentOS SCL you already add another rpm repo, so this is just about providing to RHEL users the same feature as CentOS users of this role get.

@tux-o-matic
Copy link
Contributor Author

If you fear over reaching by default, then a manage_el_scl boolean var should be controlling if CentOS SCL or RH SCL gets added/enabled on their respective OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
2 participants