diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 72237f4373..8c43c3098e 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -69,13 +69,22 @@ virtual_machines: - rhel-9-4-sap-ha container_engine: podman + # RHCOS lifecycle dates: https://access.redhat.com/support/policy/updates/openshift#dates rhcos: project: rhcos-cloud images: - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.19') }}" + # OCP 4.22 (RHEL 10.2 + 9.8), EUS until June 2029 + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 x86_64.images.gcp.name rhel-10') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 x86_64.images.gcp.name rhel-9') }}" + # OCP 4.20 (RHEL 9.6), EUS until October 2028 + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.20') }}" + # OCP 4.18 (RHEL 9.4), EUS until February 2028 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.18') }}" + # OCP 4.16 (RHEL 9.4), EUS until June 2027 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.16') }}" + # OCP 4.14 (RHEL 9.2), EUS until October 2026 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.14') }}" + # OCP 4.12 (RHEL 8.6), EUS until January 2027 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.12') }}" username: core ignition: @@ -93,8 +102,14 @@ virtual_machines: arch: arm64 machine_type: t2a-standard-2 images: - - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.19 aarch64.images.gcp.name') }}" + # OCP 4.22 (RHEL 10.2 + 9.8), EUS until June 2029 + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 aarch64.images.gcp.name rhel-10') }}" + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.22 aarch64.images.gcp.name rhel-9') }}" + # OCP 4.20 (RHEL 9.6), EUS until October 2028 + - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.20 aarch64.images.gcp.name') }}" + # OCP 4.18 (RHEL 9.4), EUS until February 2028 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.18 aarch64.images.gcp.name') }}" + # OCP 4.16 (RHEL 9.4), EUS until June 2027 - "{{ lookup('ansible.builtin.pipe', 'scripts/fetch_ocp_rhcos_bootimage.sh 4.16 aarch64.images.gcp.name') }}" username: core ignition: diff --git a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh index d90f57e016..e8034a4fb6 100755 --- a/ansible/scripts/fetch_ocp_rhcos_bootimage.sh +++ b/ansible/scripts/fetch_ocp_rhcos_bootimage.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ -z "$1" ]; then - echo "Usage: $0 []" + echo "Usage: $0 [] []" exit 1 fi @@ -10,7 +10,15 @@ OCP_VERSION=$1 # Json path with architecture and image name, e.g., x86_64.images.gcp.name or s390x.artifacts.ibmcloud.release JSONPATH=${2:-"x86_64.images.gcp.name"} -URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/rhcos.json" +# Optional RHEL variant (e.g., rhel-9, rhel-10) for OCP 4.22+ which splits +# RHCOS images into separate coreos-rhel-9.json and coreos-rhel-10.json files. +RHEL_VARIANT=${3:-""} + +if [ -n "$RHEL_VARIANT" ]; then + URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/coreos-${RHEL_VARIANT}.json" +else + URL="https://raw.githubusercontent.com/openshift/installer/release-${OCP_VERSION}/data/data/coreos/rhcos.json" +fi json_data=$(curl --retry 5 --retry-delay 2 -sS "$URL") if [ -z "$json_data" ]; then