Registering Ubuntu and Debian Servers with Spacewalk
You probably have heard of Spacewalk, the systems management solution for RHEL / CentOS and other RedHat-based systems.
It provides and manages content / package updates for all your servers along with some other features like kickstarting / bootstrapping nodes, audits and some simple config management if you dont run Chef or Puppet or similar.
However, did you know that you can meanwhile also (fully) manage your Debian/Ubuntu systems with Spacewalk ? Documentation on this is still sparse and you have to figure out certain things on your own.
Read on after the jump how to completly setup and configure Spacewalk 2.2 to work with Ubuntu clients. Including Errata !
This article only shows the Debian/Ubuntu specific things you need to know, a general Spacewalk installation needs to be done beforehand, see https://fedorahosted.org/spacewalk/wiki/HowToInstall
Create channels with ‘Architecture’ set to ‘amd64-debian’ and ‘Yum Repository Checksum Type’ to SHA256. For Ubuntu 12.04 (Precise Pangolin) I name them:
- precise # Thats the parent channel of the following
For Ubuntu 14.04 (Trusty Tahr) you would rather call them ‘trusty’
Enable epel-testing and
In /usr/lib/python2.6/site-packages/debian/debfile.py patch PART_EXTS = [‘gz‘, ‘bz2‘, ‘xz‘, ‘lzma‘] to include lzma.Meanwhile, after months of waiting, others + my patches finally made it upstream. So make sure you get python-debian-0.1.27-3 or higher from
epel-testing EPEL repo. Use https://github.com/stevemeier/spacewalk-debian-sync to get packages into the channels as Spacewalks reposync cant handle APT repos yet.I meanwhile did my own Python version / port. So get https://github.com/philicious/spacewalk-scripts/blob/master/debianSync.py . Its faster than the Perl version. Its a drop-in replacement for Steves script.
./debianSync.py --username admin --password 'XXX' --channel 'precise-updates' --url 'http://de.archive.ubuntu.com/ubuntu/dists/precise-updates/main/binary-amd64/'
./debianSync.py --username admin --password 'XXX' --channel 'precise-security' --url 'http://us.archive.ubuntu.com/ubuntu/dists/precise-security/main/binary-amd64/'
Thats already it for the Server side. Now get some clients registered with Spacewalk.
For Ubuntu 12.04 there are no official packages, so I built them. Its better to build them for 12.04 rather than adding apt source from a higher release because you will end up with alot dependency and version problems of other packages. You can easily build them by yourself on a 12.04 machine:
apt-get -f install
git clone git://anonscm.debian.org/collab-maint/spacewalk/rhnlib.git
git clone git://anonscm.debian.org/collab-maint/spacewalk/rhn-client-tools.git rhn-client-tools
git clone git://anonscm.debian.org/collab-maint/spacewalk/python-ethtool.git python-ethtool
git clone git://anonscm.debian.org/collab-maint/spacewalk/rhnsd.git rhnsd
git clone git://anonscm.debian.org/collab-maint/spacewalk/apt-spacewalk.git
# now in every of these directories do:
debuild -i -us -uc -b
# If all 5 packages are built, the debs are found at ../, now install
dpkg -i *.deb
apt-get -f install
Ubuntu 14.04, 13.10, 13.04
For these releases, the packages are available from ‘universe’ repo but they are outdated so the above is suggested.
Note: Patching xmlrpclib.py is only necessary for rhn-client-tools <=1.8.26-3 . Since version 1.8.26-4 you can skip this.
We need to fix a bug in python XMLRPCLib:
+++ new/xmlrpclib.py 2013-05-28 20:44:24.000000000 +0200
@@ -654,8 +654,8 @@
f(self, value, write)
def dump_nil (self, value, write):
- if not self.allow_none:
- raise TypeError, "cannot marshal None unless allow_none is enabled"
+# if not self.allow_none:
+# raise TypeError, "cannot marshal None unless allow_none is enabled"
dispatch[NoneType] = dump_nil
Now we can register with the Spacewalk server
rhnreg_ks --activationkey=1-ubuntu12.04-key --serverUrl=http://spacewalk.hc.lan/XMLRPC
You can now use Spacewalk as central APT repository
mv /etc/apt/sources.list /etc/apt/sources.list.bak
So far everything could be googled together from different sources. Btw this article also applies for Debian systems.
In the next upcoming article I will however show you how to get Errata automatically imported into Spacewalk from the Ubuntu security mailing list http://www.ubuntu.com/usn/ and https://lists.ubuntu.com/archives/ubuntu-security-announce/