Skip to content

Commit

Permalink
Split the way to enable support for software collection (CentOS and R…
Browse files Browse the repository at this point in the history
…HEL) (#266)

* Split the way to enable support for software collection (CentOS and RedHat)
  • Loading branch information
senyoltw authored Nov 21, 2020
1 parent 28f615c commit 036dbed
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/266-zabbix_web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bugfixes:
- zabbix_web - fixed issue Role cannot install Zabbix web 5.0 on RHEL 7 (https://github.com/ansible-collections/community.zabbix/issues/202).
minor_changes:
- zabbix_web - added `zabbix_web_rhel_release` which enable scl on RHEL (https://github.com/ansible-collections/community.zabbix/pull/266).
3 changes: 2 additions & 1 deletion docs/ZABBIX_WEB_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ The following is an overview of all available configuration defaults for this ro
* `zabbix_repo_yum_enabled`: A list with repository names that should be enabled when installing Zabbix component specific packages.

* `zabbix_web_package_state`: Default: `present`. Can be overridden to `latest` to update packages when needed.
* `zabbix_web_centos_release`: Default: False. When the `centos-release-scl` repository needs to be enabled. This is required when using Zabbix 5.0 due to installation of a recent version of `PHP`.
* `zabbix_web_centos_release`: Default: True. When the `centos-release-scl` repository needs to be enabled. This is required when using Zabbix 5.0 due to installation of a recent version of `PHP`.
* `zabbix_web_rhel_release`: Default: True. When the `scl-utils` repository needs to be enabled. This is required when using Zabbix 5.0 due to installation of a recent version of `PHP`.
* `zabbix_web_doubleprecision`: Default: `False`. For upgraded installations, please read database [upgrade notes](https://www.zabbix.com/documentation/current/manual/installation/upgrade_notes_500) (Paragraph "Enabling extended range of numeric (float) values") before enabling this option.
* `zabbix_web_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file.

Expand Down
1 change: 1 addition & 0 deletions roles/zabbix_web/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ zabbix_version: "{{ zabbix_web_version }}"
zabbix_repo: zabbix
zabbix_web_package_state: present
zabbix_web_centos_release: true
zabbix_web_rhel_release: true
zabbix_selinux: False
zabbix_web_doubleprecision: False
zabbix_web_conf_mode: "0640"
Expand Down
23 changes: 22 additions & 1 deletion roles/zabbix_web/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
tags:
- zabbix-web

- name: "RedHat | Install zabbix-web dependency (Zabbix 5.x)"
- name: "RedHat | Install zabbix-web dependency (Zabbix 5.x) (CentOS)"
yum:
pkg:
- centos-release-scl
Expand All @@ -59,6 +59,27 @@
- zabbix_version is version('5.0', '>=')
- zabbix_web_centos_release
- ansible_distribution_major_version != '8'
- ansible_distribution == "CentOS"
tags:
- zabbix-web

- name: "RedHat | Install zabbix-web dependency (Zabbix 5.x) (RHEL)"
yum:
pkg:
- scl-utils
- scl-utils-build
state: "{{ zabbix_web_package_state }}"
update_cache: yes
disablerepo: "{{ '*' if (zabbix_repo_yum_enabled | length>0) else omit }}"
enablerepo: "{{ zabbix_repo_yum_enabled if zabbix_repo_yum_enabled is iterable and (zabbix_repo_yum_enabled | length>0) else omit }}"
register: zabbix_web_dependency_package_install
until: zabbix_web_dependency_package_install is succeeded
become: yes
when:
- zabbix_version is version('5.0', '>=')
- zabbix_web_centos_release
- ansible_distribution_major_version != '8'
- ansible_distribution == "RedHat"
tags:
- zabbix-web

Expand Down

0 comments on commit 036dbed

Please sign in to comment.