[Spacewalk-list] rhn_check uses HTTP repos instead of spacewalk software channel

John Hodrien J.H.Hodrien at leeds.ac.uk
Mon Jul 11 12:09:20 UTC 2011


On Mon, 11 Jul 2011, Jan Pazdziora wrote:

> On Mon, Jul 11, 2011 at 11:23:15AM +0100, John Hodrien wrote:
>>
>> It's expected and working as designed, but it *is* an issue that's been raised
>> before so I guess he's questioning the design.  People are botching it with
>> pre/post scripts or rebuilding packages to avoid hitting external mirrors.
>> It'd be rather nice if there was already a snippet in there to do that, so all
>> we'd have to do would be to click a check box to opt out of using external
>> mirrors.
>
> So, what does setup those .repo file? What is it that puts them there?

Well, in a basic install it's centos-release.

So by default, during the default post when you register you'll hit external
repos (if you install packages with the activation key) if you don't do
something before that point.

Currently I'm doing this in pre to avoid it:

%pre --logfile /tmp/ks-pre.log.1
mkdir -p /tmp/ks-tree-shadow/etc/yum.repos.d/custom

cat << EOF > /tmp/ks-tree-shadow/etc/yum.conf
[main]
cachedir=/var/cache/yum
reposdir=/etc/yum.repos.d/custom/
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=centos-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d/custom
EOF

This gets imported back onto the system by the default post (SW 1.2) before
anything happens that would hit external mirrors, and is safe from future
package installs/upgrades that add .repo files.

jh




More information about the Spacewalk-list mailing list