Skip to content

Commit 1780e62

Browse files
Neeraj8418Neeraj Mishra
andauthored
fix: Add EC build support logic in OCP installer download task (#430)
This PR introduces logic updates in the roles/download_ocp_installer/tasks/main.yaml file to enable automated handling of Early Candidate (EC) builds for OpenShift. The code now dynamically selects the appropriate download URL based on the installer version pattern. Changes Introduced: Added conditional check for EC builds (-ec in version string). Routes EC build downloads to: https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp-dev-preview/ Maintains existing logic for regular builds from: https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/ No changes to all.yaml or inventory inputs — logic is handled directly in code. Verified backward compatibility with standard build versions. Testing Done: ✅ Tested with both EC (4.21.0-ec.2) and non-EC (4.20.2) versions. ✅ Verified correct URL resolution in ansible-playbook debug logs. ✅ Confirmed successful download and extraction of installer and client binaries. Impact: Simplifies EC build handling without requiring manual URL updates. Keeps ABI automation compatible with both GA and EC releases. No breaking changes for existing playbooks. Signed-off-by: Neeraj Mishra <[email protected]> Co-authored-by: Neeraj Mishra <[email protected]>
1 parent 3088328 commit 1780e62

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed
Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,73 @@
11
---
2+
# Section: Download OpenShift Installer (fips=false)
23
- name: Download OpenShift Installer (fips=false)
34
ansible.builtin.get_url:
4-
url: "{{ abi.ocp_installer_base_url }}/{{ abi.architecture | lower }}/clients/ocp/{{ abi.ocp_installer_version }}/{{ 's390x/' if abi.architecture | lower == 'multi' else '' }}{{ ocp_install_tgz }}"
5+
url: >-
6+
{{ (abi.ocp_installer_base_url ~ '/' ~ (abi.architecture | lower) ~ '/clients/' ~
7+
('ocp-dev-preview' if '-ec' in abi.ocp_installer_version else 'ocp') ~ '/' ~
8+
abi.ocp_installer_version ~ '/' ~
9+
('s390x/' if abi.architecture | lower == 'multi' else '') ~
10+
ocp_install_tgz) | replace(' ', '') }}
511
dest: "/tmp/{{ ocp_install_tgz }}"
612
mode: '0640'
713
validate_certs: false
814
when: not install_config_vars.fips
915

16+
# Section: Download OpenShift Installer (fips=true)
1017
- name: Download OpenShift Installer (fips=true)
1118
ansible.builtin.get_url:
12-
url: "{{ abi.ocp_installer_base_url }}/{{ abi.architecture | lower }}/clients/ocp/{{ abi.ocp_installer_version }}/{{ 's390x/' if abi.architecture | lower == 'multi' else '' }}{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture | lower }}.tar.gz"
19+
url: >-
20+
{{ (abi.ocp_installer_base_url ~ '/' ~ (abi.architecture | lower) ~ '/clients/' ~
21+
('ocp-dev-preview' if '-ec' in abi.ocp_installer_version else 'ocp') ~ '/' ~
22+
abi.ocp_installer_version ~ '/' ~
23+
('s390x/' if abi.architecture | lower == 'multi' else '') ~
24+
ocp_install_fips_tgz ~ '-' ~ (install_config_vars.control.architecture | lower) ~ '.tar.gz')
25+
| replace(' ', '') }}
1326
dest: "/tmp/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture | lower }}.tar.gz"
1427
mode: '0640'
1528
validate_certs: false
1629
when: install_config_vars.fips
1730

31+
# Section: Extract OpenShift Installer (fips=false)
1832
- name: Extract OpenShift Installer (fips=false)
1933
ansible.builtin.unarchive:
2034
src: "/tmp/{{ ocp_install_tgz }}"
2135
dest: /usr/local/bin
2236
remote_src: true
2337
when: not install_config_vars.fips
2438

39+
# Section: Extract OpenShift Installer (fips=true)
2540
- name: Extract OpenShift Installer (fips=true)
2641
ansible.builtin.unarchive:
2742
src: "/tmp/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture | lower }}.tar.gz"
2843
dest: /usr/local/bin
2944
remote_src: true
3045
when: install_config_vars.fips
3146

47+
# Section: Download OpenShift Client
3248
- name: Download OpenShift Client
3349
ansible.builtin.get_url:
34-
url: "{{ abi.ocp_installer_base_url }}/{{ abi.architecture | lower }}/clients/ocp/{{ abi.ocp_installer_version }}/{{ 's390x/' if abi.architecture | lower == 'multi' else '' }}{{ ocp_client_tgz }}"
50+
url: >-
51+
{{ (abi.ocp_installer_base_url ~ '/' ~ (abi.architecture | lower) ~ '/clients/' ~
52+
('ocp-dev-preview' if '-ec' in abi.ocp_installer_version else 'ocp') ~ '/' ~
53+
abi.ocp_installer_version ~ '/' ~
54+
('s390x/' if abi.architecture | lower == 'multi' else '') ~
55+
ocp_client_tgz) | replace(' ', '') }}
3556
dest: "/tmp/{{ ocp_client_tgz }}"
3657
mode: '0755'
3758
validate_certs: false
3859

60+
# Section: Extract OpenShift Client
3961
- name: Extract OpenShift Client
4062
ansible.builtin.unarchive:
4163
src: "/tmp/{{ ocp_client_tgz }}"
4264
dest: /usr/local/bin
4365
remote_src: true
4466

67+
# Section: Install NMState package
4568
- name: Install NMState package
4669
ansible.builtin.yum:
4770
name: nmstate
4871
state: latest
4972
skip_broken: true
73+

0 commit comments

Comments
 (0)