Skip to content

Commit

Permalink
Fix provision for CentOS Stream distributions #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Korulag committed Jun 6, 2024
1 parent bada7ec commit dcd731d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions resources/roles/install_uninstall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

- name: Enable module
shell: dnf module enable -y "{{ module_name }}:{{ module_stream }}:{{ module_version }}"
when: ansible_distribution_file_variety in ('RedHat', 'CentOS') and module_name is defined and module_stream is defined and module_version is defined
when: >
ansible_facts.os_family == 'RedHat' and
module_name is defined and module_stream is defined and module_version is defined
tags:
- install_package

Expand All @@ -12,7 +14,7 @@
state: present
allow_downgrade: true
lock_timeout: 300
when: ansible_distribution_file_variety in ('RedHat', 'OracleLinux', 'CentOS')
when: ansible_facts.os_family == 'RedHat'
tags:
- install_package

Expand All @@ -32,7 +34,7 @@
retries: 30
delay: 10
until: result.rc == 0
when: ansible_distribution_file_variety in ('RedHat', 'OracleLinux', 'CentOS')
when: ansible_facts.os_family == 'RedHat'
tags:
- uninstall_package

Expand Down
2 changes: 1 addition & 1 deletion resources/roles/preparation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: Initial provision for RPM distributions
include_tasks:
file: rhel.yml
when: ansible_distribution_file_variety in ('RedHat', 'OracleLinux')
when: ansible_facts.os_family == 'RedHat'
tags:
- initial_provision

Expand Down
6 changes: 4 additions & 2 deletions resources/roles/preparation/tasks/rhel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
with_items:
- "os"
- "updates"
when: "ansible_distribution_file_variety == 'RedHat' and ansible_facts.distribution_major_version == '6'"
when: >
ansible_distribution_file_variety in ('RedHat', 'CentOS') and
ansible_facts.distribution_major_version == '6'
- name: Add YUM proxy
ini_file:
Expand Down Expand Up @@ -92,7 +94,7 @@
when: >
epel_release_url is defined and
epel_release_url and
ansible_distribution_file_variety in ('RedHat', 'OracleLinux') and
ansible_facts.os_family == 'RedHat' and
ansible_facts.distribution_major_version in ('6', '7')
- name: Disable epel on 7 version 32-bit
Expand Down

0 comments on commit dcd731d

Please sign in to comment.