[Spacewalk-list] Installed CentOS 7 - Yum Repos Not Correct

Speagle, Andy andy.speagle at wichita.edu
Tue Jul 28 18:08:36 UTC 2015


> > I finally got CentOS 7 to install from my SW 2.3 server... but for some
> > reason, the yum repos that were configured for the new machine we're
> > my spacewalk channels... but were the default CentOS 7 repos... for some
> reason.
> >
> > Does anyone know why this might be?
> >
> > Thanks!
> >
> > Andy Speagle
> 
> Hello,
> 
> I will assume this is your first time using Spacewalk and kickstarting.

This is definitely not my first rodeo with Spacewalk.  However, it is with CentOS 7 installs.
 
> Server, while tied into Spacewalk/Satellite is still configured to pull
> from external repos.  You must make a configuration change on the server
> to stop that behavior.
> 
> Typically, I have a kickstart snippet that disables external repos.
> 
> The snippet contains the following (excluding the ==start== and ==stop==):
> 
> ==start==
> 
> # Disable all foreign yum repositories allowing only from
> Spacewalk/Satellite
> 
> mkdir -p /tmp/ks-tree-shadow/etc/yum.repos.d/custom
> 
> cat > /tmp/ks-tree-shadow/etc/yum.conf <<'END_OF_FILE'
> [main]
> cachedir=/var/cache/yum
> reposdir=/etc/yum.repos.d/custom/
> keepcache=0
> debuglevel=2
> logfile=/var/log/yum.log
> distroverpkg=redhat-release
> tolerant=1
> exactarch=1
> obsoletes=1
> gpgcheck=1
> plugins=1
> 
> # Note: yum-RHN-plugin doesn't honor this.
> metadata_expire=1h
> 
> # Allow only up to 3 kernels to be installed at one time installonly_limit
> = 3
> 
> # PUT YOUR REPOS HERE OR IN separate files named file.repo # in
> /etc/yum.repos.d/custom END_OF_FILE
> 
> ==end==
> 
> Then, if you REALLY need external repos, you put a symlink from
> /etc/yum.repos.d/custom/<file> to the actual file in
> /etc/yum.repos.d/<file>
> 
> Hope that helps

Sure, that's helpful... but I found the real problem.  The issue was with the rhnlib package that is forcibly pulled in and installed as a part of the internals of the kickstart process as part of spacewalk.  I created a "spacewalk tools" child channel for my CentOS 7 base channel, built from the latest (2.3) RHEL 7 client packages from the spacewalk site:

http://spacewalk.redhat.com/yum/latest-client/RHEL/7/x86_64/

So.. this causes the kickstart to pull in this rhnlib package:

rhnlib-2.5.75-1.el7.noarch.rpm

The version of the package included with CentOS 7 is:

rhnlib-2.5.65-2.el7.noarch.rpm

As part of the kickstart process, registration is done via the "rhnreg_ks" utility... which is included in the rhn-setup package, which is this version in the CentOS 7 channel:

rhn-setup-2.0.2-6.el7.noarch.rpm

However, that updated rhnlib packages includes a connections.py that no longer implements the "idn_ascii_to_pune" function that the old rhnreg_ks eventually needs... it instead implements the newer "idn_ascii_to_puny" function... which is used by the updated rhnreg_ks included in the updated rhn-setup from the spacewalk client child channel:

rhn-setup-2.3.16-1.el7.noarch.rpm

So... in order to make all of that work, I had to implement a new post script that grabbed the rhn-setup package and dependencies before the built-in registration happens... which I pretty much just plagiarized from the built-in registration function's work:

mkdir -p /tmp/rhn_rpms/optional
cd /tmp/rhn_rpms/optional 
wget -P /tmp/rhn_rpms/optional http://spacewalk.wichita.edu/download/package/fcb44ada56d57e6fc033f7e19262952b4acee26f/1438140090557/1/194028/rhn-client-tools-2.3.16-1.el7.noarch.rpm http://spacewalk.wichita.edu/download/package/858a8a53048464399ab3b3468d8e4591be728aab/1438140073338/1/194025/rhn-setup-2.3.16-1.el7.noarch.rpm http://spacewalk.wichita.edu/download/package/dced25a61ed01c6df170f7c74e4302ffa4445f9f/1438140105463/1/194019/rhn-check-2.3.16-1.el7.noarch.rpm

rpm -Uvh --replacepkgs --replacefiles /tmp/rhn_rpms/optional/rhn*

Seems to me that this needs to be resolved in the workings of the built-in registration script ... unless I'm missing something else.

Andy







More information about the Spacewalk-list mailing list