From dd0ee239897b64b3d102604809d424bb22fa6a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Fri, 31 Mar 2023 09:33:39 +0200 Subject: [PATCH] Update satellite_repo labels + add env var Red Hat changed the repository names/labels for Satellite Client repository in Satellite 6.11 and above, See: https://access.redhat.com/solutions/7004377 This change updates the satellite_repo URL's to use the new labels. Also adds environment variable REG_SAT_REPO to allow the user to override the repository label. Closes-Bug: #2013451 Change-Id: I6c2a93658213644140caf0e4a8c910b1af22cd1c --- .../elements/rhel-common/README.rst | 13 +++++++++++++ .../pre-install.d/00-rhel-registration | 6 +++--- .../notes/bug-2013451-0874e20db0231c56.yaml | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/bug-2013451-0874e20db0231c56.yaml diff --git a/diskimage_builder/elements/rhel-common/README.rst b/diskimage_builder/elements/rhel-common/README.rst index c7674f82..908acbcf 100644 --- a/diskimage_builder/elements/rhel-common/README.rst +++ b/diskimage_builder/elements/rhel-common/README.rst @@ -122,6 +122,19 @@ is applicable to both physical systems and virtual guests. Other types include hypervisor for virtual hosts, person, domain, rhui, and candlepin for some subscription management applications. +#### REG\_SAT\_REPO +Sets the repository label for Satellite client tools. The defaults are: + ++------------+--------------------------------------------+ +| Release | Repository label | ++============+============================================+ +| RHEL 7 | rhel-7-server-satellite-client-6-rpms | ++------------+--------------------------------------------+ +| RHEL 8 | satellite-client-6-for-rhel-8-${arch}-rpms | ++------------+--------------------------------------------+ +| RHEL 9 | satellite-client-6-for-rhel-9-${arch}-rpms | ++------------+--------------------------------------------+ + Image Build Registration Examples ------------------------------------ To register with Satellite 6, a common example would be to set the following diff --git a/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration b/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration index f1671ef9..ed6f8fea 100755 --- a/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration @@ -15,17 +15,17 @@ base_repos= if [ "${DIB_RELEASE:-7}" == "7" ]; then base_repos="rhel-7-server-rpms" - satellite_repo="rhel-7-server-rh-common-rpms" + satellite_repo="${REG_SAT_REPO:-"rhel-7-server-satellite-client-6-rpms"}" elif [ "${DIB_RELEASE}" == "8" ]; then if [ -n "${REG_RELEASE:-}" ]; then base_repos="rhel-8-for-${arch}-appstream-eus-rpms rhel-8-for-${arch}-baseos-eus-rpms" else base_repos="rhel-8-for-${arch}-appstream-rpms rhel-8-for-${arch}-baseos-rpms" fi - satellite_repo="satellite-tools-6.5-for-rhel-8-${arch}-rpms" + satellite_repo="${REG_SAT_REPO:-"satellite-client-6-for-rhel-8-${arch}-rpms"}" elif [ "${DIB_RELEASE}" == "9" ]; then base_repos="rhel-9-for-${arch}-appstream-rpms rhel-9-for-${arch}-baseos-rpms" - satellite_repo="rhel-9-for-${arch}-highavailability-rpms" + satellite_repo="${REG_SAT_REPO:-"satellite-client-6-for-rhel-9-${arch}-rpms"}" fi REG_SAT_CERT=${REG_SAT_CERT:-"katello-ca-consumer-latest.noarch.rpm"} diff --git a/releasenotes/notes/bug-2013451-0874e20db0231c56.yaml b/releasenotes/notes/bug-2013451-0874e20db0231c56.yaml new file mode 100644 index 00000000..f5c09293 --- /dev/null +++ b/releasenotes/notes/bug-2013451-0874e20db0231c56.yaml @@ -0,0 +1,16 @@ +--- +features: + - | + Added environment variable ``REG_SAT_REPO`` to the ``rhel-common`` + element. Sets the repository label for Satellite client tools. +fixes: + - | + The ``Satellite Client`` reposotories replaces the ``Satellite Tools`` + repository since Satellite 6.11. The default repo labels in the + ``rhel-common`` element has been updated to reflect this change. + See `Red Hat Satellite 6.11 Release Notes `_. + + To enable users that need to use the legacy ``Satellite Tools`` + repository, the ``REG_SAT_REPO`` environment variable has been added to + enable manual override of the Satellite repository. +