Skip to content

Commit

Permalink
Update LTSS 7 registration script (#27)
Browse files Browse the repository at this point in the history
jsc#SLL-368
  • Loading branch information
tahliar authored Jul 4, 2024
1 parent 1537c8e commit ec91b3d
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 33 deletions.
34 changes: 19 additions & 15 deletions xml/app-temp-script.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
is shown here. Save this script as <filename>rmt-client-setup-res</filename>.
</para>

<screen>#!/bin/sh
<screen>#!/bin/bash

SUSECONNECT=/usr/bin/SUSEConnect
RPM=/usr/bin/rpm
Expand Down Expand Up @@ -139,7 +139,7 @@ else
CERTURL="$REGCERT"
fi

$CURL --tlsv1.2 --silent --insecure --connect-timeout 10 --output $TEMPFILE $CERTURL
$CURL --tlsv1.2 --silent --insecure --connect-timeout 10 --output "$TEMPFILE" "$CERTURL"
if [ $? -ne 0 ]; then
echo "Download failed. Abort."
exit 1
Expand Down Expand Up @@ -183,14 +183,12 @@ echo "Detected ${SLL_name} version: ${SLL_version}"

echo "Importing repomd.xml.key"
if [[ ${SLL_version} -eq 7 ]]; then
$CURL --silent --show-error --insecure ${REGURL}/repo/SUSE/Updates/${SLL_name%%-LTSS}/${SLL_version}-LTSS/x86_64/update/repodata/repomd.xml.key --output repomd.xml.key
$CURL --silent --show-error --insecure "${REGURL}/repo/SUSE/Updates/${SLL_name%%-LTSS}/${SLL_version}-LTSS/x86_64/update/repodata/repomd.xml.key" --output repomd.xml.key
else
$CURL --silent --show-error --insecure ${REGURL}/repo/SUSE/Updates/${SLL_name}/${SLL_version}/x86_64/update/repodata/repomd.xml.key --output repomd.xml.key
$CURL --silent --show-error --insecure "${REGURL}/repo/SUSE/Updates/${SLL_name}/${SLL_version}/x86_64/update/repodata/repomd.xml.key" --output repomd.xml.key
fi
$RPM --import repomd.xml.key

if [ ! -x $SUSECONNECT ]; then
echo "Downloading SUSEConnect"
if [[ ${SLL_version} -gt 7 ]]; then

if [ ! -x $DNF ]; then
Expand All @@ -200,22 +198,23 @@ if [[ ${SLL_version} -gt 7 ]]; then

echo "Disabling all repositories"
$DNF config-manager --disable $(dnf repolist -q | awk '{ print $1 }' | grep -v repo)
# sed -i 's/^enabled=1/enabled=0/' /etc/yum.repos.d/*
# on RHEL9 (not RHEL8) redhat-release is protected and cannot be updated to sll-release
if [ -f /etc/dnf/protected.d/redhat-release.conf ]; then
rm -f /etc/dnf/protected.d/redhat-release.conf
fi

$DNF config-manager --add-repo ${REGURL}/repo/SUSE/Updates/${SLL_name}/${SLL_version}/x86_64/update
$DNF config-manager --add-repo ${REGURL}/repo/SUSE/Updates/${SLL_name}-AS/${SLL_version}/x86_64/update
$DNF config-manager --add-repo "${REGURL}/repo/SUSE/Updates/${SLL_name}/${SLL_version}/x86_64/update"
$DNF config-manager --add-repo "${REGURL}/repo/SUSE/Updates/${SLL_name}-AS/${SLL_version}/x86_64/update"
$DNF install -y --allowerasing ${SLL_release_package}

# For RHEL8/CentOS8, remove all old signing keys and import SUSE keys installed with sles_es-release package
if [[ ${SLL_version} -eq 8 ]]; then
import_rpm_signing_keys
fi

echo "Downloading SUSEConnect"
$DNF install SUSEConnect librepo

$DNF config-manager --set-disabled "${RMTNAME}_repo_SUSE_Updates_${SLL_name}_${SLL_version}_x86_64_update"
$DNF config-manager --set-disabled "${RMTNAME}_repo_SUSE_Updates_${SLL_name}-AS_${SLL_version}_x86_64_update"

Expand All @@ -235,25 +234,30 @@ elif [[ ${SLL_version} -eq 7 ]]; then
rm -f /usr/share/redhat-release
fi

$YUM_CONFIG_MGR --add-repo ${REGURL}/repo/SUSE/Updates/${SLL_name%%-LTSS}/${SLL_version}-LTSS/x86_64/update
$YUM_CONFIG_MGR --add-repo "${REGURL}/repo/SUSE/Updates/${SLL_name%%-LTSS}/${SLL_version}-LTSS/x86_64/update"
if [ ${SLL_name} = "RES-OL-LTSS" ]; then
$YUM_CONFIG_MGR --add-repo ${REGURL}/repo/SUSE/Updates/RES-BASE/${SLL_version}/x86_64/update
$YUM_CONFIG_MGR --add-repo "${REGURL}/repo/SUSE/Updates/RES-BASE/${SLL_version}/x86_64/update"
fi
$YUM_CONFIG_MGR --enable *suse.* &gt; /dev/null

$YUM install -y ${SLL_release_package} suseconnect-ng librepo
if [ ! -x $SUSECONNECT ]; then
$YUM install -y ${SLL_release_package} suseconnect-ng librepo
else
$YUM update -y ${SLL_release_package} suseconnect-ng librepo
fi

$YUM update -y yum
$YUM_CONFIG_MGR --disable \* &gt; /dev/null
fi

elif [[ ${SLL_version} -eq 8 ]]; then
# For SLL8, the release package is already installed, just import the keys
import_rpm_signing_keys
fi

$CURL --silent --show-error --insecure $REGURL/tools/rmt-client-setup --output rmt-client-setup
$CURL --silent --show-error --insecure "$REGURL/tools/rmt-client-setup" --output rmt-client-setup
echo "Running rmt-client-setup $PARAMS"
if [ -n "$YES_PARAM" ]; then
PARAMS=$(echo $PARAMS | sed 's/--yes//')
PARAMS=$(echo "$PARAMS" | sed 's/--yes//')
yes | sh rmt-client-setup $PARAMS
else
sh rmt-client-setup $PARAMS
Expand Down
6 changes: 3 additions & 3 deletions xml/art-quickstart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@
</para>
<para>
To register new &rhla;&nbsp;&productnumber; or CentOS&nbsp;Linux&nbsp;&productnumber;
systems, <!--and to continue receiving new updates for existing systems, -->you must purchase a
systems, and to continue receiving new updates for existing systems, you must purchase a
<emphasis>&reponame; &productnumber;</emphasis> subscription.
</para>
<para>
Additionally, the optional &ha; extension is no longer supported with
&reponame; &productnumber;. You must remove this product from your system
before you can register with an LTSS subscription.
</para>
<!--para>
<para>
If you previously registered your systems with a general subscription and want to move
them to an LTSS subscription, see <xref linkend="mirror-repositories-with-rmt"/>
and <xref linkend="register-7-with-rmt"/>.
</para-->
</para>
</important>
<para>
&productname; is a technology and support solution for mixed Linux environments.
Expand Down
9 changes: 6 additions & 3 deletions xml/mirror-repositories-with-rmt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@
<para>
There are no new &ha; repositories. &ha; is not supported with &reponame; &productnumber;.
</para>
<!--para>
<para>
If you previously mirrored the &productname; repositories with the general subscription,
clean up these repositories first before you start mirroring the new LTSS repositories:
</para>
<orderedlist>
<listitem>
<para>
Disable the original product. This also disables any repositories associated with the product:
Disable the original product. This also disables all repositories associated with the product:
</para>
<screen>&prompt.root;<command>rmt-cli product disable 1251</command></screen>
</listitem>
Expand All @@ -78,14 +78,17 @@
If your previous subscription included the &ha; extension, disable this product too:
</para>
<screen>&prompt.root;<command>rmt-cli product disable 1252</command></screen>
<para>
&ha; is not supported with &reponame; &productnumber;.
</para>
</listitem>
<listitem>
<para>
Free up space on the server by cleaning up the files associated with the disabled repositories:
</para>
<screen>&prompt.root;<command>rmt-cli repos clean</command></screen>
</listitem>
</orderedlist-->
</orderedlist>
</important>

<procedure xml:id="pro-mirror-repositories-with-rmt">
Expand Down
35 changes: 23 additions & 12 deletions xml/register-with-rmt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,22 +71,33 @@
</listitem>
</itemizedlist>

<!--important audience="sll">
<important audience="sll">
<title>New registration setup for &reponame; &productnumber;</title>
<para>
The repository structure and registration setup has changed in &reponame; &productnumber;.
If you previously registered your system with a general &productname; subscription,
de-register your system from the original subscription and re-register with the LTSS subscription.
</para>
<para>
To de-register your system, run the following command:
</para>
<screen>&prompt.root;<command>SUSEConnect -/-de-register</command></screen>
<para>
This command also removes the &ha; extension if it was installed on your system.
&ha; is not supported with &reponame; &productnumber;.
</para>
</important-->
de-register your system from the original subscription before you re-register
with the LTSS subscription:
</para>
<orderedlist>
<listitem>
<para>
De-register your system:
</para>
<screen>&prompt.root;<command>SUSEConnect --de-register</command></screen>
<para>
This command also removes the &ha; extension if it was installed on your system.
&ha; is not supported with &reponame; &productnumber;.
</para>
</listitem>
<listitem>
<para>
Clean up the registration status:
</para>
<screen>&prompt.root;<command>SUSEConnect --cleanup</command></screen>
</listitem>
</orderedlist>
</important>

<procedure xml:id="pro-register-rhel-with-rmt">
<title>Registering <phrase audience="sll">&rhla; or </phrase>CentOS Linux with &rmt;</title>
Expand Down

0 comments on commit ec91b3d

Please sign in to comment.