Skip to content

Update setup-RedHat.yml #91

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@
set_fact: php_enablerepo="remi,remi-php83"
when: php_version == "8.3"

# See: https://github.com/ansible/ansible/issues/64852
- block:

- name: https://github.com/ansible/ansible/issues/64852
when: ansible_distribution_major_version | int >= 8
block:
- name: Ensure dnf-plugins are installed on CentOS 8+.
yum:
ansible.builtin.dnf:
name: dnf-plugins-core
state: present

- name: Enable crb and DNF module for CentOS 8+.
shell: |
dnf config-manager --set-enabled crb
dnf module enable -y php:remi-{{ php_version }}
register: dnf_module_enable
changed_when: "'Nothing to do' not in dnf_module_enable.stdout"
- name: Enable DNF module for CentOS 8+.
ansible.builtin.dnf:
name: "@php:remi-{{ php_version }}"
state: present

when:
- ansible_os_family == 'RedHat'
Copy link
Author

Choose a reason for hiding this comment

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

This condition is not necessary because it is declared at a higher level.

- ansible_distribution_major_version | int >= 8
- name: Ensure the crb repository is enabled on CentOS 9+.
community.general.dnf_config_manager:
name: crb
state: enabled
when: ansible_distribution_major_version | int >= 9