[Spacewalk-list] moving spacewalk clients from the one to another spacewalk server

Michiel van Es michiele at info.nl
Wed Jan 6 10:26:05 UTC 2010


Hi Colin,

GPG keys are not an issue as I install by default the CentOS-devel,
rpmforge and epelrpo gpg keys.
I managed to make a simple script which works fine for my CentOS 5 boxes:

This is the script:

#!/bin/bash
# Check if the OS matches Red hat or CentOS
OS=`cat /etc/redhat-release | awk {'print $1}'`
VERSIE=`cat /etc/redhat-release | awk '{print $3}' | awk -F. '{print $1}'`
arch=`uname -i`
if [ "$OS" != "CentOS" ]; then
   echo 'This is not a CentOS server, exiting now!'
   exit 1
# Check if the version is 4 or 5 - the only working spacewalk versions
elif [ "$VERSIE" != "5" ]; then
echo 'Sorry the new Spacewalk server is not CentOS 3 or 4 ready..exiting'
exit 1
#
### test for i386
#
              elif [ "$arch" = "i386" ]; then
                 echo we see you use the $arch architecture
                 echo we will start now:

URL="fac03.hf.info.nl"
ACTKEY='***'
#
rhnreg_ks --force --serverUrl=http://$URL/XMLRPC --activationkey="$ACTKEY"
   cd /usr/share/rhn/
     mv RHNS-CA-CERT RHNS-CA-CERT_OLD_SPACEWALK_CERT
     mv RHN-ORG-TRUSTED-SSL-CERT RHN-ORG-TRUSTED-SSL-CERT_OLD_SPACEWALK_CERT
     wget -q http://"$URL"/pub/RHN-ORG-TRUSTED-SSL-CERT
     mv RHN-ORG-TRUSTED-SSL-CERT RHNS-CA-CERT
service rhnsd restart && service osad restart
echo ''
echo 'Please check if everything works by using yum update or yum
install vim-enhanced'
echo ''
echo 'The remove the system out of the old spacewalk server: DEVMX01'
echo 'And add the machine in the correct group on the new spacewalk
server: FAC03.HF.INFO.NL'
#
#### test for x86_64
#
              elif [ "$arch" = "x86_64" ]; then
                 echo we see you use the $arch architecture
                 echo we will start now:
URL="fac03.hf.info.nl"
ACTKEY='***'
#
rhnreg_ks --force --serverUrl=http://$URL/XMLRPC --activationkey="$ACTKEY"
cd /usr/share/rhn/
     mv RHNS-CA-CERT RHNS-CA-CERT_OLD_SPACEWALK_CERT
     mv RHN-ORG-TRUSTED-SSL-CERT RHN-ORG-TRUSTED-SSL-CERT_OLD_SPACEWALK_CERT
     wget -q http://"$URL"/pub/RHN-ORG-TRUSTED-SSL-CERT
     mv RHN-ORG-TRUSTED-SSL-CERT RHNS-CA-CERT
service rhnsd restart && service osad restart
echo ''
echo 'Please check if everything works by using yum update or yum
install vim-enhanced'
echo ''
echo ''
echo 'The remove the system out of the old spacewalk server: DEVMX01'
echo 'And add the machine in the correct group on the new spacewalk
server: FAC03.HF.INFO.NL'
          else
echo 'this script couldnt find an architecture which is capable of using
spacewalk'
echo 'we did not found a correct CentOS version, exiting now!'
fi


perhaps it is some use for some :)


Kind regards,

Michiel


-------- Original Message --------
Subject: Re: [Spacewalk-list] moving spacewalk clients from the one to 
another 	spacewalk server
From: Colin Coe <colin.coe at gmail.com>
To: Michiel van Es <Michiele at info.nl>
Date: 01/06/2010 12:03 AM

> Hi Michiel
>
> Sure, those steps will get the client registered and maybe even the
> appropriate base channel, but what about child channels, GPG keys for
> custom software channels, etc.
>
> The scripts are easily extendable as they use custom information keys
> on the satellite/spacewalk server as their 'config file'.  For
> example, the custom info key 'msc_config_locations_hp' which contains
> 'perth:10.22.100.0/24,10.22.101.0/24,10.22.102.128/25,10.22.103.128/25
> sydney:10.22.174.0/24,10.22.175.0/24' is used to set nodes within an
> IP space to the appropriate location.  This is then used to join
> specific config channels.  It's extendable as to add options all you
> need to do is create the custom info key and then a bit of python to
> handle the required logic.
>
> The three steps you list will do the job and if you are only using
> spacewalk for updates then thats fine.  My problem was that I had many
> nodes to join a Satellite server.  There were custom software channels
> and config channels to deal with and I didn't want to have to do
> everything manually.
>
> CC
>
> On 1/5/10, Michiel van Es<michiele at info.nl>  wrote:
>> Hi Colin,
>>
>> Why are you using kickstart scripts for machines that already are there?
>> Aren't the 3 steps I posted enough :
>>
>> 1) rhnreg_ks --serverUrl=http://"spacewalkserverB"/XMLRPC
>> --activationkey="$ACTKEY"
>> 2) cd /usr/share/rhn/
>> wget -q
>> http://"spacewalkserverB"/pub/RHN-ORG-TRUSTED-SSL-CERT
>> mv RHN-ORG-TRUSTED-SSL-CERT RHNS-CA-CERT
>>   3) restart rhnsd and osad= service rhnsd restart&&   service osad restart
>>
>> Kind regards,
>>
>> Michiel
>>
>> -------- Original Message --------
>> Subject: Re: [Spacewalk-list] moving spacewalk clients from the one to
>> another spacewalk server
>> From: Colin Coe<colin.coe at gmail.com>
>> To: spacewalk-list at redhat.com<spacewalk-list at redhat.com>
>> Date: 01/05/2010 11:12 AM
>>
>>> I've written a suite of scripts to do just this but it's probably
>> overkill.
>>>
>>> The scripts are (from memory):
>>> 1) make_sat_client_backend.pl
>>> - intended to be run on the Spacewalk/Satellite server
>>> - creates kickstart profiles and activationkeys used by the client
>>> 2) make_sat_client.py
>>> - uses the appropriate kickstart profile and activation key to join
>>> the required spacewalk server.
>>> 3) init_sat_client
>>> - does a bunch of useful post join stuff
>>>
>>> If people are interested, I'll post them but they are built are my
>>> requirements and may not suite everybody.
>>>
>>> CC
>>>
>>> On Tue, Jan 5, 2010 at 5:38 PM, James
>> Hogarth<james.hogarth at gmail.com>   wrote:
>>>
>>>> You may need to change /etc/sysconfig/rhn/up2date with the new severURL
>>>> (doubt rhnreg_ks will do that automatically... but may be wrong)
>>>>
>>>> 2010/1/5 Michiel van Es<michiele at info.nl>
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have a spacewalk server A where all my CentOS 5 clients are
>> connected to
>>>>> (rhnsd and osad) but I want to migrate them to spacewalk server B.
>>>>> How do I switch those clients to spacewalk server B?
>>>>> Do I have to do the following:
>>>>>
>>>>> 1) rhnreg_ks
>> --serverUrl=http://"spacewalkserverB"/XMLRPC
>>>>> --activationkey="$ACTKEY"
>>>>> 2) cd /usr/share/rhn/
>>>>> wget -q
>> http://"spacewalkserverB"/pub/RHN-ORG-TRUSTED-SSL-CERT
>>>>> mv RHN-ORG-TRUSTED-SSL-CERT RHNS-CA-CERT
>>>>> 3) restart rhnsd and osad= service rhnsd restart&&   service osad
>> restart
>>>>>
>>>>> Kind regards,
>>>>>
>>>>> Michiel
>>>>>
>>>>> _______________________________________________
>>>>> Spacewalk-list mailing list
>>>>> Spacewalk-list at redhat.com
>>>>>
>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Spacewalk-list mailing list
>>>> Spacewalk-list at redhat.com
>>>>
>> https://www.redhat.com/mailman/listinfo/spacewalk-list
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>
>




More information about the Spacewalk-list mailing list