Grant Gainey edited this page Dec 12, 2016 · 2 revisions
Clone this wiki locally

This page is now obsolete. See Registering Clients for up-to-date instructions.

Managing Fedora Systems Via Spacewalk

If you've got a few Fedora workstations you're likely to want to have some sort of centralised management for them. Spacewalk is one tool which can provide this. We assume you have a spacewalk server and the need to deploy multiple Fedora clients. This guide is based around Fedora 9, please feel free to add any additional notes for other versions.

Channel Setup

We'll create a channel holding all the Fedora rpms you may want to deploy to clients. It is encouraged that you use a sub-channel for each repository you pull from. For example we have a "Fedora 9 x86_64" channel. This channel contains all the Fedora 9 packages from Fedora. A "Livna" sub-channel contains packages from the livna repository. Essentially you want the following structure

  • Fedora 9 x86_64 chanel
    • Livna sub-channel
    • My custom packages sub-channel

The UploadFedoraContent page describes how to create a channel, reposync your required repositories and then upload the content to spacewalk. At the end of this process you'll end up with a copy of the entire Fedora repository on your disk and another copy living inside of spacewalk (actually in /var/satellite). This consumes quite a bit of space. Furthermore rhnpush'ing an entire Fedora repository to a spacewalk server can take several days. Some have managed it in a single day, others find it takes 2-3 days on more modest hardware.

You'll periodically want to resync the Fedora repository and upload the updated packages to spacewalk. This is a repeat of the 2-3 day rhnpush process. You then have to push the updated packages to your clients. This pushing practice is described below.

Provisioning Clients

Kickstart is possibly the easiest way to provision your clients. It allows you to define the packages to install, authentication configuration etc... in a central spot. Then each of your clients will be deployed with the same configuration. It's a lot more manageable than creating a system imaging and rolling that out over multiple clients. Spacewalk will allow you to define a kickstart profile. You'll then have to follow KickstartDistro to upload Fedora content. A kickstart will only install content from the kickstart tree. It will not install content that is available in the "Fedora 9 x86_64" channel. We find that kickstart is useful for provisioning your systems with the base and X Windows packages and with our authentication mechanism. We deploy other packages using Spacewalk. This allows us to update the packages on the system more easily.

Then using a Fedora boot CD in the client (advanced users can check out PXE booting) you can specify "ks= http://my.spacewalk.server/kickstart/ks/org/1x6454525425678f7ae02542542541cf/label/fedora-9-x86_64" as a kernel boot parameter. The client will automatically download the kickstart file and configure itself accordingly. This is a bare-metal kickstart, so it's important you use the kickstart URL as given to you by "Systems->Kickstart Details->Bare Metal Kickstart". Furthermore, that big ugly number that you have to type is your organisation id. We created a USB boot disk (using Fedora's Revisor application) with the bare metal kickstart URL in the boot parameters. This means that we simply plug the USB disk into the machine, turn it on and go get some coffee.

Registering Clients

For this we want an activation key. Create a spacewalk activation key and associate it with your "Fedora 9 x86_64" channel. It's important that the key is associated with a specific channel and not just the default. You then have to install packages on the client and register with your server. The process is described in RegisteringClients. However, if you've been kickstarting your clients you may want this to happen as part of the kickstart process.

As a precondition to this process you must ensure that your Fedora kickstart installs the m2crpto package. This must be within your kickstart tree. With Fedora 9 and Spacewalk 0.3 automatically registering clients requires creating a Post Script for your kickstart containing the following; do note that you must replace your spacewalk server URL and activation key below.

# Set a proxy (if required)
export http_proxy=

cd /tmp

# Install keys
# Fedora newkey
# Livna
# Rpm fusion
# You should host these keys on your own web server.

rpm --import RPM-LIVNA-GPG-KEY
rpm --import RPM-GPG-KEY-fedora-x86_64
rpm --import RPM-GPG-KEY-rpmfusion-free-fedora
rpm --import RPM-GPG-KEY-rpmfusion-nonfree-fedora
rpm --import RPM-GPG-KEY-fedora-8-and-9
rpm --import RPM-GPG-KEY-fedora-8-and-9-x86_64

# Install packages necessary for registration

# This is _very_ necessary


# Don't check the signature of RPMs as the spacewalk key may change to the Fedora one soon(ish)
# Don't check deps as there's a missing Python dep in rhnlib (it's not missing, the rpm file just thinks it is)
rpm --install -v --hash --nosignature --nodeps *.rpm

# install our ORG Spacewalk key from a http source.  Not a good idea when concerned with security, but it works.
wget http://some.internal.sercer/RHN-ORG-TRUSTED-SSL-CERT
mkdir /usr/share/rhn/
perl -npe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i /etc/sysconfig/rhn/*

# Make up2date look at our server (my servers name is
perl -npe 's/' -i /etc/sysconfig/rhn/up2date
mkdir -p /etc/sysconfig/rhn/allowed-actions/configfiles
touch /etc/sysconfig/rhn/allowed-actions/configfiles/all

# Clean up
rm m2*.rpm
rm rhn*.rpm
rm yum*.rpm

# Do the actual registration (put your actual activation key in place of the dummy one)
rhnreg_ks --serverUrl= --activationkey=1-dcdcdcdcdcdcdcdcdcdcdcdcdcd

Pushing Packages to Clients

Managing Client Configurations

Related Documentation