[Spacewalk-list] Spacewalk channel layout and syncscript for centos5

Thomas von Steiger thomas.vonsteiger at bluewin.ch
Wed Aug 27 21:19:53 UTC 2008


Hi,

Here i send you how i have running centos5 online sync to the  
spacewalk centos5 channels.
Maybe there is anybody how can use this.

I use reposync from the yum-utils package and runpush from the rhnpush  
package.
I have running spacewalk on a 32bit xen guest centos5 and there are  
filesystems for reposync and spacewalk self like:

/var/satellite 15Gb with use 70% for 32bit and 64bit centos5
/something/repo	10Gb with use 60% for reposync 32bit centos5

and on a other 64bit centos5 xen guest i have a filesystem:

/something/repo with use 60% for reposync 64bit centos5

This i because reposync from yum-utils use always the current host arch.
Current i don't know how i can sync 32bit repos on 64bit arch or 64bit  
repos on 32bit arch.

For both nodes 32bit and 64bit centos5 i have a scipt as cronjob  
running.
For this script there are channels required on the spacewalk with  
channel label descriped in the script sync_repo2spacewalk
and there is a user/pw required with the role "Channel Administrator"  
on the spacewalk.


This are my channels summary and description:

  CentOS 5 Base i386 (32bit)
  CentOS 5 i386 (32bit) Addons
  CentOS 5 i386 (32bit) Centosplus	
  CentOS 5 i386 (32bit) Extras
  CentOS 5 i386 (32bit) Updates

  CentOS 5 Base x86_64 (64bit)
  CentOS 5 x86_64 (64bit) Addons
  CentOS 5 x86_64 (64bit) Centosplus
  CentOS 5 x86_64 (64bit) Extras
  CentOS 5 x86_64 (64bit) Updates


Script for sync repo 2 spacewalk:
----
#!/bin/bash
# Scriptname: sync_repo2spacewalk
# Sync Repo to Spacewalk
# Need: $OS-$R-$ARCH channel labels on Spacewalk
# where $R = {base,extras,centosplus,updates}
# Must: ARCH == arch from host where this script is running.


LOGFILE=/var/log/sync_repo2spacewalk.log
REPODIR=/something/repo/spacewalk

# Use the host arch where the script is running.
ARCH=i386
USER=mySyncUser
PWD=mySyncPw
SERVER=http://myspacewalk.domain.name
OS=centos-5
REPOS="base extras centosplus updates"
OPTS="--username=$USER --password=$PWD --newest -v"


echo "Start sync repo 2 spacewalk for $REPODIR/$ARCH" > $LOGFILE

if [ -d $REPODIR/$ARCH ]; then
    cd $REPODIR/$ARCH
    for R in $REPOS
    do
       reposync --repoid=$R && \
       if [ $R = "base" ]; then
          RDIR=$REPODIR/$ARCH/$R/CentOS
       else
          RDIR=$REPODIR/$ARCH/$R/RPMS
       fi
       rhnpush $OPTS --server=$SERVER/APP --channel=$OS-$R-$ARCH --dir= 
$RDIR >> $LOGFILE
       echo "reposync and rhnpush done for $OS-$R-$ARCH" >> $LOGFILE
    done
else
    echo "Missing $REPODIR/$ARCH..." >> $LOGFILE
fi

exit 0
----

It's possible to remove "base" from REPOS after the first run to save  
performance on the spacewalk.

Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: list-collapse.gif
Type: image/gif
Size: 864 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel_child_node.gif
Type: image/gif
Size: 81 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment-0001.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel_child_node.gif
Type: image/gif
Size: 81 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment-0002.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel_child_node.gif
Type: image/gif
Size: 81 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment-0003.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel_child_node.gif
Type: image/gif
Size: 81 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20080827/60bb1c0c/attachment-0004.gif>


More information about the Spacewalk-list mailing list