[Spacewalk-list] automatic registration w/ spacewalk after kickstart

Craig Pendleton craig.pendleton at healthlanguage.com
Thu Jul 16 17:32:57 UTC 2009


This is sloppy at best, but it works for us.  This is based on a script I
found somewhere (on SW wiki, or elsewhere).  I would like to attribute it to
the original author, but don't know the source.  We use this for throw-away
test systems, so keep in mind that security is a non-issue for our needs
here (hence the "rpm -Uvh --nosignature").  There is probably a far better
way to do this with yum - would love to hear about it if so.

I have this in my kickstart postinstall script:

# Spacewalk post script

cd /tmp

# Install keys
# Spacewalk
# Extra Packages for Enterprise Linux (EPEL)
wget http://spacewalk.redhat.com/yum/RPM-GPG-KEY-spacewalk
wget http://mirrors.kernel.org/fedora-epel/RPM-GPG-KEY-EPEL

rpm --import RPM-GPG-KEY-spacewalk
rpm --import RPM-GPG-KEY-EPEL

# Install packages necessary for registration
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhn-check-0.4.24
-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhn-client-tools
-0.4.24-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhn-setup-0.4.24
-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhn-setup-gnome-
0.4.24-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhnlib-2.5.10-1.
el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhnpush-0.4.7-1.
el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/yum-rhn-plugin-0
.5.4-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/spacewalk-koan-0
.1.11-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhncfg-5.9.5-1.e
l5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhncfg-actions-5
.9.5-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhncfg-client-5.
9.5-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/rhncfg-managemen
t-5.9.5-1.el5.noarch.rpm
wget 
http://spacewalk.redhat.com/yum/0.5/RHEL/5/i386/os/Packages/osad-5.9.10-1.el
5.noarch.rpm
wget 
http://mirrors.kernel.org/fedora-epel/5/i386/koan-1.6.1-1.el5.noarch.rpm
wget 
http://mirrors.kernel.org/fedora-epel/5/i386/jabberpy-0.5-0.17.el5.noarch.rp
m

rpm -Uvh --nosignature --nodeps *.rpm

# Install our ORG Spacewalk key from a http source.

wget http://itks01.healthlanguage.com/pub/RHN-ORG-TRUSTED-SSL-CERT
mkdir /usr/share/rhn/
cp RHN-ORG-TRUSTED-SSL-CERT /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
perl -npe 's/RHNS-CA-CERT/RHN-ORG-TRUSTED-SSL-CERT/g' -i
/etc/sysconfig/rhn/*


On 7/16/09 10:22 AM, "John Hodrien" <J.H.Hodrien at leeds.ac.uk> wrote:

> On Thu, 16 Jul 2009, Ian Hayes wrote:
> 
>> I had a similar problem with CentOS and Fedora 10. I wound up writing a bash
>> script that I wget and execute after first boot, but I know this isn't the
>> proper behavior.
> 
> Equally I've just hashed it up as a postscript when problems like this have
> bitten, as a failed registration followed by a successful registration is a
> successful registration...
> 
> jh
> 
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list


Thanks,
Craig 


----
NOTICE BY HEALTH LANGUAGE, INC.
This message, as well as any attached document, contains information from Health Language, Inc. that is confidential.  The information is intended only for the use of the addressee named above.  If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of this message or its attachments is strictly prohibited, and may be unlawful.  If you have received this message in error, please delete all electronic copies of this message and its attachments, if any, destroy any hard copies you may have created, without disclosing the contents, and notify the sender immediately.  Unless expressly stated otherwise, nothing contained in this message should be construed as a digital or electronic signature, nor is it intended to reflect an intention to make an agreement by electronic means.




More information about the Spacewalk-list mailing list