Skip to content

Commit b8b9b56

Browse files
authored
Fix comparison distribution versions during environment provisioning (#152)
1 parent 79ea0e4 commit b8b9b56

File tree

1 file changed

+4
-4
lines changed
  • resources/roles/preparation/tasks

1 file changed

+4
-4
lines changed

resources/roles/preparation/tasks/rhel.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
- name: Re-define procps package name
2525
set_fact:
2626
procps_pkg: "procps-ng"
27-
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version > '6'"
27+
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version | int > 6"
2828

2929
- set_fact:
3030
additional_packages:
@@ -37,13 +37,13 @@
3737
pip_packages:
3838
- python3-pip
3939
- python3-setuptools
40-
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version >= '8'"
40+
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version | int >= 8"
4141

4242
- set_fact:
4343
pip_packages:
4444
- python-pip
4545
- python-setuptools
46-
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version < '8'"
46+
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version | int < 8"
4747

4848
- name: Add os and updates repositories for version 6
4949
yum_repository:
@@ -115,7 +115,7 @@
115115
name: epel-release
116116
state: present
117117
lock_timeout: 300
118-
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version >= '8'"
118+
when: "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version | int >= 8"
119119

120120
- name: Install epel-release (7 and less)
121121
yum:

0 commit comments

Comments
 (0)