Skip to content

Commit e9ee426

Browse files
committed
Add conditionals for Rhel9 in common role
Signed-off-by: Aswathy S Kumar <aswathyskumar144@gmail.com>
1 parent afb0e11 commit e9ee426

File tree

1 file changed

+9
-9
lines changed
  • ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks

1 file changed

+9
-9
lines changed

ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Common/tasks/RedHat.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
- ansible_architecture == "x86_64"
1717
tags: patch_update
1818

19-
- name: Enable EPEL release for RHEL8 or RHEL6 or RHEL7
19+
- name: Enable EPEL release for RHEL9 or RHEL8 or RHEL6 or RHEL7
2020
yum: name=https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
2121
failed_when: false
2222
when:
2323
- ansible_architecture != "s390x"
24-
- (ansible_distribution_major_version == "8") or (ansible_distribution_major_version == "6") or (ansible_distribution_major_version == "7")
24+
- (ansible_distribution_major_version | int >= 6)
2525
tags: patch_update
2626

2727
- name: YUM upgrade all packages
@@ -52,11 +52,11 @@
5252
##########################
5353
# Additional build tools #
5454
##########################
55-
- name: Install additional build tools if NOT RHEL 8
55+
- name: Install additional build tools if NOT RHEL 8 AND RHEL9
5656
package: "name={{ item }} state=latest"
5757
with_items: "{{ Additional_Build_Tools_NOT_RHEL8 }}"
5858
when:
59-
- (ansible_distribution_major_version != "8")
59+
- not (ansible_distribution_major_version | int >= 8)
6060
tags: build_tools
6161

6262
- name: Install additional build tools for RHEL 7
@@ -102,11 +102,11 @@
102102
- (ansible_distribution_major_version == "6") or (ansible_distribution_major_version == "7")
103103
tags: build_tools
104104

105-
- name: Install additional build tools for RHEL 8
105+
- name: Install additional build tools for RHEL >= 8
106106
package: "name={{ item }} state=latest"
107107
with_items: "{{ Additional_Build_Tools_RHEL8 }}"
108108
when:
109-
- (ansible_distribution_major_version == "8")
109+
- (ansible_distribution_major_version | int >= 8)
110110
tags: build_tools
111111

112112
- name: Install jq for SBoM parsing for build reproducibility testing
@@ -136,17 +136,17 @@
136136
with_items: "{{ Java_NOT_RHEL6_PPC64 }}"
137137
when:
138138
- not (ansible_distribution_major_version == "6" and ansible_architecture == "ppc64")
139-
- not (ansible_distribution_major_version == "8")
139+
- not (ansible_distribution_major_version | int >= 8)
140140

141141
- name: Install Java when RedHat 6 on ppc64
142142
package: "name={{ item }} state=latest"
143143
with_items: "{{ Java_RHEL6_PPC64 }}"
144144
when: (ansible_distribution_major_version == "6" and ansible_architecture == "ppc64")
145145

146-
- name: Install Java when RedHat 8
146+
- name: Install Java when RedHat 8 and RedHat 9
147147
package: "name={{ item }} state=latest"
148148
with_items: "{{ Java_RHEL8 }}"
149-
when: (ansible_distribution_major_version == "8")
149+
when: (ansible_distribution_major_version | int >= 8)
150150

151151
####################
152152
# Set default Java #

0 commit comments

Comments
 (0)