Skip to content

Commit 554975b

Browse files
Neeraj8418Neeraj Mishra
and
Neeraj Mishra
authored
Multiarch support for abi (#404)
This PR adds support for downloading OpenShift installer and client binaries for both single (s390x) and multi-architecture (multi) configurations. Changes: Dynamically constructs the download URL based on the value of abi.architecture. For multi, appends the architecture-specific subdirectory (s390x/) to the URL. Ensures the correct binaries are fetched and extracted regardless of the architecture setup. Purpose: To streamline support for multi-arch environments while maintaining compatibility with existing single-architecture deployments. --------- Signed-off-by: Neeraj Mishra <[email protected]> Co-authored-by: Neeraj Mishra <[email protected]>
1 parent e8d8e1d commit 554975b

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

docs/set-variables-group-vars.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@
200200
:--- | :--- | :---
201201
**abi.flag** | This is the flag, Will be used to identify during execution. Few checks in the playbook will be depend on this (default value will be False) | True
202202
**abi.ansible_workdir** | This will be work directory name, it will keep required data that need to be present during or after execution | ansible_workdir
203-
**abi.ocp_installer_version** | Version will contain value of openshift-installer binary version user desired to be used | '4.15.0-rc.8'
204-
**abi.ocp_installer_url** | This is the base url of openshift installer binary it will remain same as static value, User Do not need to give value until user wants to change the mirror | 'https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/'
203+
**abi.ocp_installer_version** | Version will contain value of openshift-installer binary version user desired to be used | '4.15.8'
204+
**abi.ocp_installer_base_url** | This is the base url of openshift installer binary it will remain same as static value, User Do not need to give value until user wants to change the mirror | 'https://mirror.openshift.com/pub/openshift-v4/'
205+
**abi.architecture** | The installer binary supports two architecture options: multi and s390x. Users are required to specify the appropriate architecture value based on their deployment environment. | 'multi/s390x'
206+
**abi.boot_method** | Specifies the boot type for Agent-based Installation (ABI). Users must choose either iso or pxe based on the deployment method. Note: iso boot is supported only on KVM platforms. | 'iso/pxe'
205207

206208
## OpenShift Settings
207209
* The parameters bellow have a hierachical structure and need to be added to all.yaml in given format. For example if you want to change the hyperthreading (disable) than you need to specify the following value in all.yaml file:

inventories/default/group_vars/all.yaml.template

+3-2
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ day2_compute_node:
229229
abi:
230230
flag: False
231231
ansible_workdir: 'ansible_workdir'
232-
ocp_installer_version: '4.15.0-rc.8'
233-
ocp_installer_url: 'https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/'
232+
ocp_installer_version: '4.18.8'
233+
ocp_installer_base_url: 'https://mirror.openshift.com/pub/openshift-v4'
234+
architecture: <multi|s390x>
234235
boot_method: <pxe|iso>
235236

236237
# Openshift Settings

roles/download_ocp_installer/tasks/main.yaml

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
---
2-
- name: Download OpenShift Installer (fips=false).
2+
- name: Download OpenShift Installer (fips=false)
33
ansible.builtin.get_url:
4-
url: "{{ abi.ocp_installer_url }}{{ abi.ocp_installer_version }}/openshift-install-linux.tar.gz"
5-
dest: /tmp
6-
mode: '640'
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+
dest: "/tmp/{{ ocp_install_tgz }}"
6+
mode: '0640'
77
validate_certs: false
88
when: not install_config_vars.fips
99

10-
- name: Download OpenShift Installer (fips=true).
10+
- name: Download OpenShift Installer (fips=true)
1111
ansible.builtin.get_url:
12-
url: "{{ abi.ocp_installer_url }}{{ abi.ocp_installer_version }}/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture }}.tar.gz"
13-
dest: /tmp
14-
mode: '640'
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"
13+
dest: "/tmp/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture | lower }}.tar.gz"
14+
mode: '0640'
1515
validate_certs: false
1616
when: install_config_vars.fips
1717

18-
- name: Extract & Unzip Downloaded OpenShift Installer tar file on Remote (fips=false)
18+
- name: Extract OpenShift Installer (fips=false)
1919
ansible.builtin.unarchive:
20-
src: /tmp/openshift-install-linux.tar.gz
20+
src: "/tmp/{{ ocp_install_tgz }}"
2121
dest: /usr/local/bin
2222
remote_src: true
2323
when: not install_config_vars.fips
2424

25-
- name: Extract & Unzip Downloaded OpenShift Installer tar file on Remote (fips=true)
25+
- name: Extract OpenShift Installer (fips=true)
2626
ansible.builtin.unarchive:
27-
src: /tmp/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture }}.tar.gz
27+
src: "/tmp/{{ ocp_install_fips_tgz }}-{{ install_config_vars.control.architecture | lower }}.tar.gz"
2828
dest: /usr/local/bin
2929
remote_src: true
3030
when: install_config_vars.fips
3131

32-
- name: Download OpenShift Client.
32+
- name: Download OpenShift Client
3333
ansible.builtin.get_url:
34-
url: "{{ ocp_download_url }}{{ ocp_client_tgz }}"
35-
dest: "/tmp/"
36-
mode: "0755"
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 }}"
35+
dest: "/tmp/{{ ocp_client_tgz }}"
36+
mode: '0755'
37+
validate_certs: false
3738

38-
- name: Extract & Unzip Downloaded OpenShift Client tar file on Remote
39+
- name: Extract OpenShift Client
3940
ansible.builtin.unarchive:
40-
src: "{{ ocp_download_url }}{{ ocp_client_tgz }}"
41+
src: "/tmp/{{ ocp_client_tgz }}"
4142
dest: /usr/local/bin
4243
remote_src: true
4344

0 commit comments

Comments
 (0)