Deploy/SpaceWalk/Upload

De TartareFR
Aller à la navigation Aller à la recherche
LogoSpacewalk.svg

Importer des paquets dans Spacewalk

Introduction

Pour utiliser Spacewalk, il faut d'abord lui importer des paquets RPM. Il y a deux façons de faire:

  1. spacewalk-repo-sync: pour importer/synchroniser tout un dépôt
  2. rhnpush: pour ajouter directement des paquets

Mais avant tout, Spacewalk a besoin d'avoir des définitions de channels

Créer des Channels

Création via Interface Web

La façon la plus simple est de le faire à partir de l'interface web. On s'identifie et depuis le menu

"Channels"->"Manage Software Channels"-> "Create"

SpaceWalkChannelAdd.png

On va créer les channels de base, ainsi que les channels enfants (dépôts additionnels) pour:

  • CentOS 5 32 bits
  • CentOS 5 64 bits
  • CentOS 6 32 bits
  • CentOS 6 64 bits

SpacewalkAllChannels.png

Channels pour CentOS 5 32 bits


IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Base - i386
  • Channel Label: centos5-base-i386
  • Parent Channel: (none)
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Base for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Updates - i386
  • Channel Label: centos5-updates-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Updates for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Extras - i386
  • Channel Label: centos5-extras-i386
  • Parent Channel: CentOS 5 Extras - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Extras for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Rpmforge - i386
  • Channel Label: centos5-rpmforge-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Rpmforge for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 EPEL - i386
  • Channel Label: centos5-epel-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 EPEL for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 B2PWeb - i386
  • Channel Label: centos5-b2pweb-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 B2PWeb for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Percona - i386
  • Channel Label: centos5-percona-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Percona for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Spacewalk Client - i386
  • Channel Label: centos5-spacewalkclient-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Spacewalk Client for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 VBox - i386
  • Channel Label: centos5-vbox-i386
  • Parent Channel: CentOS 5 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 VBox for i386 architecture

Security: GPG

Channels pour CentOS 5 64 bits


IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Base - x86_64
  • Channel Label: centos5-base-x86_64
  • Parent Channel: (none)
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 Base for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Updates - x86_64
  • Channel Label: centos5-updates-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 Updates for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Extras - x86_64
  • Channel Label: centos5-extras-x86_64
  • Parent Channel: CentOS 5 Extras - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 5 Extras for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Rpmforge - x86_64
  • Channel Label: centos5-rpmforge-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 Rpmforge for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 EPEL - x86_64
  • Channel Label: centos5-epel-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 EPEL for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 B2PWeb - x86_64
  • Channel Label: centos5-b2pweb-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 B2PWeb for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Percona - x86_64
  • Channel Label: centos5-percona-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 Percona for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 Spacewalk Client - x86_64
  • Channel Label: centos5-spacewalkclient-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 Spacewalk Client for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 5 VBox - x86_64
  • Channel Label: centos5-vbox-x86_64
  • Parent Channel: CentOS 5 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 5 VBox for x86_64 architecture

Security: GPG

Channels pour CentOS 6 32 bits


IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Base - i386
  • Channel Label: centos6-base-i386
  • Parent Channel: None
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Base for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Updates - i386
  • Channel Label: centos6-updates-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Updates for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Extras - i386
  • Channel Label: centos6-extras-i386
  • Parent Channel: CentOS 6 Extras - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Extras for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Rpmforge - i386
  • Channel Label: centos6-rpmforge-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Rpmforge for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 EPEL - i386
  • Channel Label: centos6-epel-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 EPEL for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 B2PWeb - i386
  • Channel Label: centos6-b2pweb-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 B2PWeb for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Percona - i386
  • Channel Label: centos6-percona-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Percona for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Spacewalk Client - i386
  • Channel Label: centos6-spacewalkclient-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Spacewalk Client for i386 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 VBox - i386
  • Channel Label: centos6-vbox-i386
  • Parent Channel: CentOS 6 Base - i386
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 VBox for i386 architecture

Security: GPG

Channels pour CentOS 6 64 bits


IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Base - x86_64
  • Channel Label: centos6-base-x86_64
  • Parent Channel: None
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 Base for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Updates - x86_64
  • Channel Label: centos6-updates-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 Updates for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Extras - x86_64
  • Channel Label: centos6-extras-x86_64
  • Parent Channel: CentOS 6 Extras - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: IA-32
  • Summary: CentOS 6 Extras for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Rpmforge - x86_64
  • Channel Label: centos6-rpmforge-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 Rpmforge for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 EPEL - x86_64
  • Channel Label: centos6-epel-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 EPEL for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 B2PWeb - x86_64
  • Channel Label: centos6-b2pweb-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 B2PWeb for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Percona - x86_64
  • Channel Label: centos6-percona-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 Percona for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 Spacewalk Client - x86_64
  • Channel Label: centos6-spacewalkclient-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 Spacewalk Client for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 VBox - x86_64
  • Channel Label: centos6-vbox-x86_64
  • Parent Channel: CentOS 6 Base - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 VBox for x86_64 architecture

Security: GPG

IconChannel16.pngCanal

Basic Channel Details

  • Channel Name: CentOS 6 JPackage - x86_64
  • Channel Label: centos6-jpackage-x86_64
  • Parent Channel: CentOS 6 JPackage - x86_64
  • Yum Repository Checksum Type: sha1
  • Architecture: x86_64
  • Summary: CentOS 6 JPackage for x86_64 architecture

Security: GPG

Création via <app>spacewalk-common-channels</app>

Alternativement, on peut utiliser en ligne de commande, le script <app>spacewalk-common-channels</app> du paquet <package>spacewalk-utils</package>pour créer les channels préconfigurés. Il peut aussi créer les clés d'activation et les définitions des dépôts externes.

Par exemple pour créer les channels i386 et x86_64 pour CentOS 5, les clés d'activations et les sous-channels clients:

/usr/bin/spacewalk-common-channels -v -u admin -p pass -a i386,x86_64 -k unlimited 'centos5*' 'spacewalk-nightly-client*'

Usage:

# spacewalk-common-channels -h
Usage: spacewalk-common-channels [options] <channel1 glob> [<channel2 glob> ... ]

Options:
  -c CONFIG, --config=CONFIG
                        configuration file
  -u USER, --user=USER  username
  -p PASSWORD, --password=PASSWORD
                        password
  -s SERVER, --server=SERVER
                        your spacewalk server
  -k KEY_LIMIT, --keys=KEY_LIMIT
                        activation key usage limit - 'unlimited' or number
                        (default: options is not set and activation keys are
                        not created at all)
  -n, --dry-run         perform a trial run with no changes made
  -a ARCHS, --archs=ARCHS
                        list of architectures
  -v, --verbose         verbose
  -l, --list            print list of available channels
  -h, --help            show this help message and exit


Examples:

Create Fedora 12 channel, its child channels and activation key limited to 10 servers:
    /usr/bin/spacewalk-common-channels -u admin -p pass -k 10 'fedora12*'

Create Centos 5 with child channels only on x86_64:
    /usr/bin/spacewalk-common-channels -u admin -p pass -a x86_64 'centos5*'

Create only Centos 4 base channels for intel archs:
    /usr/bin/spacewalk-common-channels -u admin -p pass -a i386,x86_64 'centos4'

Create Spacewalk client child channel for every (suitable) defined base channel:
    /usr/bin/spacewalk-common-channels -u admin -p pass 'spacewalk-client*'

Create everything as well as unlimited activation key for every channel:
    /usr/bin/spacewalk-common-channels -u admin -p pass -k unlimited '*'

Repo-sync

Déclaration des dépôts

On va maintenant déclarer nos dépôts (repositories)

Goto Channels -> Manage Software Channels -> Manage Repositories -> create new repository

SpaceWalkRepoAdd.png

Repository pour CentOS 5 32 bits


IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt

Repository pour CentOS 5 64 bits


IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt

Repository pour CentOS 6 32 bits


IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt

Repository pour CentOS 6 64 bits


IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt
IconRepo16.pngDépôt

Mise en place de la liaison channel/dépôt

Après avoir créer les dépôts, nous devons les lier à un channel.

Goto: Channels
   -> Manage Software Channels
       -> Choose the channel to be linked 
           -> Repositories 
               -> Select the repositories to be linked to the channel 
                   -> Update Repositories.

SpaceWalkRepoSync.png

Note.png
Channels créés avec <app>spacewalk-common-channels</app>
Si le script <app>spacewalk-common-channels</app> a été utilisé, les dépôts sont déjà lier au channel correspondant.

Maintenant on peut synchroniser les dépôts via l'interface web ou en ligne de commande.

spacewalk-repo-sync --channel CHANNEL_LABEL 

N'importe quelle adresse de dépôt supporté par <app>yum</app> peut être utilisé (http://, file://, etc...). En ligne de commande, il faut être le super-utilisateur root pour synchroniser.

Voir la page <app>man</app> pour plus d'information

man 8 spacewalk-repo-sync


Idea.png
Erreur "yum.Errors.NoMoreMirrorsRepoError"
Si l'erreur "yum.Errors.NoMoreMirrorsRepoError" apparait durant une synchronisation, il faut installer le paquet <package>python-hashlib</package>.

Les logs se trouvent dans <path>/var/log/rhn/reposync/</path>

Script pour synchroniser automatiquement les dépôts <path>/etc/cron.daily/spacewalk_sync.cron</path>

#!/bin/sh
# try to create the lock and check the outcome
LOCKFILE=/var/run/spacewalk_sync.lock

if [ -f "${LOCKFILE}" ]
then
        echo "Another instance already running. Aborting."
        exit 1
fi

echo $(date) > ${LOCKFILE}
trap ${LOCKFILE} KILL

/usr/bin/spacewalk-repo-sync --channel centos5-base-i386
/usr/bin/spacewalk-repo-sync --channel centos5-base-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-base-i386
/usr/bin/spacewalk-repo-sync --channel centos6-base-x86_64
 
/usr/bin/spacewalk-repo-sync --channel centos5-updates-i386
/usr/bin/spacewalk-repo-sync --channel centos5-updates-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-updates-i386
/usr/bin/spacewalk-repo-sync --channel centos6-updates-x86_64
 
/usr/bin/spacewalk-repo-sync --channel centos5-extras-i386
/usr/bin/spacewalk-repo-sync --channel centos5-extras-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-extras-i386
/usr/bin/spacewalk-repo-sync --channel centos6-extras-x86_64
 
/usr/bin/spacewalk-repo-sync --channel centos5-rpmforge-i386
/usr/bin/spacewalk-repo-sync --channel centos5-rpmforge-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-rpmforge-i386
/usr/bin/spacewalk-repo-sync --channel centos6-rpmforge-x86_64
 
/usr/bin/spacewalk-repo-sync --channel centos5-epel-i386
/usr/bin/spacewalk-repo-sync --channel centos5-epel-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-epel-i386
/usr/bin/spacewalk-repo-sync --channel centos6-epel-x86_64

/usr/bin/spacewalk-repo-sync --channel centos5-b2pweb-i386
/usr/bin/spacewalk-repo-sync --channel centos5-b2pweb-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-b2pweb-i386
/usr/bin/spacewalk-repo-sync --channel centos6-b2pweb-x86_64

/usr/bin/spacewalk-repo-sync --channel centos5-percona-i386
/usr/bin/spacewalk-repo-sync --channel centos5-percona-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-percona-i386
/usr/bin/spacewalk-repo-sync --channel centos6-percona-x86_64

/usr/bin/spacewalk-repo-sync --channel centos5-spacewalkclient-i386
/usr/bin/spacewalk-repo-sync --channel centos5-spacewalkclient-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-spacewalkclient-i386
/usr/bin/spacewalk-repo-sync --channel centos6-spacewalkclient-x86_64

/usr/bin/spacewalk-repo-sync --channel centos5-vbox-i386
/usr/bin/spacewalk-repo-sync --channel centos5-vbox-x86_64
/usr/bin/spacewalk-repo-sync --channel centos6-vbox-i386
/usr/bin/spacewalk-repo-sync --channel centos6-vbox-x86_64

/usr/bin/spacewalk-repo-sync --channel centos6-jpackage-x86_64

rm -f ${LOCKFILE}

On pourra vérifier le bon appairage en interrogeant la base de données.

psql -d spaceschema -U spaceuser -W
Idea.png
Mot de passe
Le mot de passe de l'utilisateur spaceuser pour le serveur Postgresql est swpasswd.
select C.name, C.label, CS.source_url 
    from rhnChannel C 
    inner join rhnChannelContentSource CCS on CCS.channel_id = C.id 
    inner join rhnContentSource CS on CS.id = CCS.source_id;
Correspondance entre les channels et les URLs
name label source_url
CentOS 5 Base - i386 centos5-base-i386 http://mirror.centos.org/centos/5/os/i386/
CentOS 5 Updates - i386 centos5-updates-i386 http://mirror.centos.org/centos/5/updates/i386/
CentOS 5 Extras - i386 centos5-extras-i386 http://mirror.centos.org/centos/5/extras/i386/
CentOS 5 Rpmforge - i386 centos5-rpmforge-i386 http://apt.sw.be/redhat/el5/en/i386/rpmforge/
CentOS 5 EPEL - i386 centos5-epel-i386 http://mirrors.ircam.fr/pub/fedora/epel/5/i386/
CentOS 5 Percona - i386 centos5-percona-i386 http://repo.percona.com/centos/5/os/i386/
CentOS 5 Spacewalk Client - i386 centos5-spacewalkclient-i386 http://spacewalk.redhat.com/yum/2.0-client/RHEL/5/i386/
CentOS 5 VBox - i386 centos5-vbox-i386 http://download.virtualbox.org/virtualbox/rpm/el/5/i386/
CentOS 5 B2PWeb - i386 centos5-b2pweb-i386 http://koji.b2pweb.com/repos/centos/5/os/RPMS/i386/
CentOS 5 Base - x86_64 centos5-base-x86_64 http://mirror.centos.org/centos/5/os/x86_64/
CentOS 5 Updates - x86_64 centos5-updates-x86_64 http://mirror.centos.org/centos/5/updates/x86_64/
CentOS 5 Extras - x86_64 centos5-extras-x86_64 http://mirror.centos.org/centos/5/extras/x86_64/
CentOS 5 Rpmforge - x86_64 centos5-rpmforge-x86_64 http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/
CentOS 5 EPEL - x86_64 centos5-epel-x86_64 http://mirrors.ircam.fr/pub/fedora/epel/5/x86_64/
CentOS 5 Percona - x86_64 centos5-percona-x86_64 http://repo.percona.com/centos/5/os/x86_64/
CentOS 5 Spacewalk Client - x86_64 centos5-spacewalkclient-x86_64 http://spacewalk.redhat.com/yum/2.0-client/RHEL/5/x86_64/
CentOS 5 VBox - x86_64 centos5-vbox-x86_64 http://download.virtualbox.org/virtualbox/rpm/el/5/x86_64/
CentOS 5 B2PWeb - x86_64 centos5-b2pweb-x86_64 http://koji.b2pweb.com/repos/centos/5/os/RPMS/x86_64/
CentOS 6 Base - i386 centos6-base-i386 http://mirror.centos.org/centos/6/os/i386/
CentOS 6 Updates - i386 centos6-updates-i386 http://mirror.centos.org/centos/6/updates/i386/
CentOS 6 Extras - i386 centos6-extras-i386 http://mirror.centos.org/centos/6/extras/i386/
CentOS 6 Rpmforge - i386 centos6-rpmforge-i386 http://apt.sw.be/redhat/el6/en/i386/rpmforge/
CentOS 6 EPEL - i386 centos6-epel-i386 http://mirrors.ircam.fr/pub/fedora/epel/6/i386/
CentOS 6 Percona - i386 centos6-percona-i386 http://repo.percona.com/centos/6/os/i386/
CentOS 6 Spacewalk Client - i386 centos6-spacewalkclient-i386 http://spacewalk.redhat.com/yum/2.0-client/RHEL/6/i386/
CentOS 6 VBox - i386 centos6-vbox-i386 http://download.virtualbox.org/virtualbox/rpm/el/6/i386/
CentOS 6 B2PWeb - i386 centos6-b2pweb-i386 http://koji.b2pweb.com/repos/centos/6/os/RPMS/i386/
CentOS 6 Base - x86_64 centos6-base-x86_64 http://mirror.centos.org/centos/6/os/x86_64/
CentOS 6 Updates - x86_64 centos6-updates-x86_64 http://mirror.centos.org/centos/6/updates/x86_64/
CentOS 6 Extras - x86_64 centos6-extras-x86_64 http://mirror.centos.org/centos/6/extras/x86_64/
CentOS 6 Rpmforge - x86_64 centos6-rpmforge-x86_64 http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/
CentOS 6 EPEL - x86_64 centos6-epel-x86_64 http://mirrors.ircam.fr/pub/fedora/epel/6/x86_64/
CentOS 6 Percona - x86_64 centos6-percona-x86_64 http://repo.percona.com/centos/6/os/x86_64/
CentOS 6 Spacewalk Client - x86_64 centos6-spacewalkclient-x86_64 http://spacewalk.redhat.com/yum/2.0-client/RHEL/6/x86_64/
CentOS 6 VBox - x86_64 centos6-vbox-x86_64 http://download.virtualbox.org/virtualbox/rpm/el/6/x86_64/
CentOS 6 JPackage - x86_64 centos6-jpackage-x86_64 http://ftp.heanet.ie/pub/jpackage/6.0/generic/free/
CentOS 6 B2PWeb - x86_64 centos6-b2pweb-x86_64 http://koji.b2pweb.com/repos/centos/6/os/RPMS/x86_64/

rhnpush

Si les paquets à ajouter à Spacewalk ne sont pas dans un dépôt yum, on peut les pousser directement avec la commande <app>rhnpush</app>.

Par exemple, pour pousser un répertoire appelé dir_of_packges à un channel my-custom-channel:

rhnpush -v --channel=my-custom-channel --server=http://localhost/APP --dir=dir_of_packages


Warning.png
Répertoire de destination
Il faut être sûr que le répertoire <path>/var/satellite</path> existe sur le serveur Spacewalk et a comme propriétaire:groupe apache avant de lancer cette commande.

L'option -v affiche la progression:

# rhnpush -v --channel=rhel-x86_64-server-5 --server=http://localhost/APP --dir=update
Connecting to http://localhost/APP
Package /root/update/xorg-x11-drv-vga-4.1.0-2.1.x86_64.rpm Not Found on RHN Server -- Uploading
Uploading package /root/update/xorg-x11-drv-vga-4.1.0-2.1.x86_64.rpm
Using POST request
Package /root/update/gnome-python2-gconf-2.16.0-1.fc6.x86_64.rpm Not Found on RHN Server -- Uploading
Uploading package /root/update/gnome-python2-gconf-2.16.0-1.fc6.x86_64.rpm
Using POST request
Note.png
Scan du répertoire
Le scan pour trouver des RPMs dans le répertoire déclaré avec l'option --dir=suchandsuch n'est pas récursif.

Channel-to-update

If you are using CenOS or RHEL content, and wish to create channels according to an update level. You may be interested in this script here.

Regularly syncing yum repositories

Ce script va obtenir les informationations pour la mise à jour directement depuis la base de données et lancer la commande <app>spacewalk-repo-sync</app> pour chaque channel. Il peut-être lancé par un cron.

#!/usr/bin/python
import os
import sys
import fcntl

# we only want one instance running
pid_file = '/var/lock/subsys/sync_repos.py.run'
fp = open(pid_file, 'w')
try:
    fcntl.lockf(fp, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
    # another instance is running
    sys.exit(0)

# import rhn libraries
sys.path.append('/usr/share/rhn')
try:
   from spacewalk.server import rhnSQL
except:
   print "Couldn't load needed libs, Are you sure you are running this on a satellite?"
   sys.exit(1)

# initialise rhn database library
rhnSQL.initDB()

# setup a query from all channels and their repositories
query = """ select C.id, C.name, C.label, CS.source_url
               from rhnChannel C inner join 
                    rhnChannelContentSource CCS on CCS.channel_id = C.id inner join
                    rhnContentSource CS on CS.id = CCS.source_id"""

# run the query
h = rhnSQL.prepare(query)
h.execute()
list = h.fetchall_dict()

# iterate over the query to sync all repositories
for row in list:
    sync_command="spacewalk-repo-sync --type=yum --url='%s' --channel='%s'" % (row['source_url'], row['label'] )
    print sync_command
    os.system(sync_command)