« Deploy/SpaceWalk/Upload » : différence entre les versions

De TartareFR
Aller à la navigation Aller à la recherche
Aucun résumé des modifications
Aucun résumé des modifications
Ligne 1 : Ligne 1 :
[[Fichier:LogoSpacewalk.svg|right]]
[[Fichier:LogoSpacewalk.svg|right]]
= Upload content to Spacewalk =
'''Importer des paquets dans Spacewalk'''


In order to use Spacewalk, you need to populate it with content.  There are two ways to do this:
== Introduction ==
# spacewalk-repo-sync (For syncing yum repos)
# rhnpush (For simply pushing a rpms directly to the spacewalk server)


Before doing either of these things, you will need to create a custom software channel within spacewalk.
Pour utiliser Spacewalk, il faut d'abord lui importer des paquets RPM. Il y a deux façons de faire:
# '''spacewalk-repo-sync''': pour importer/synchroniser tout un dépôt
# '''rhnpush''': pour ajouter directement des paquets


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


The easiest way to create a channel is through. the WebUI.  Simply log in and navigate to the "Channels"->"Manage Software Channels"-> "Create"  page. 
== Créer des Channels ==


Alternatively you can use <app>spacewalk-common-channels</app> script from <package>spacewalk-utils</package> package to create a predefined set of channel from the command line. It also creates desired activation keys and definitions for external repositories.
=== Création via Interface Web ===


For example, to create i386 and x86_64 channels for CentOS 5, activation keys and their spacewalk client subchannels:
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"
 
[[Fichier:SpaceWalkChannelAdd.png|800px]]
 
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
 
[[Fichier:SpacewalkAllChannels.png]]
==== Channels pour CentOS 5 32 bits ====
{{Spacewalk/channel |name=CentOS 5 Base - i386 |label=centos5-base-i386 |parent= |arch=IA-32 |checksum=sha1 |summary=CentOS 5 Base for i386 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 |gpgid=E8562897 |gpgfingerprint=473D 66D5 2122 71FD 51CC 17B1 A8A4 47DC E856 2897 }}
{{Spacewalk/channel |name=CentOS 5 Updates - i386 |label=centos5-updates-i386 |parent=CentOS 5 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 5 Updates for i386 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 |gpgid=E8562897 |gpgfingerprint=473D 66D5 2122 71FD 51CC 17B1 A8A4 47DC E856 2897 }}
{{Spacewalk/channel |name=CentOS 5 Rpmforge - i386 |label=centos5-rpmforge-i386 |parent=CentOS 5 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 5 Rpmforge for i386 architecture |gpgurl=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt |gpgid=6B8D79E6 |gpgfingerprint=EBC6 E12C 62B1 C734 026B  2122 A20E 5214 6B8D 79E6 }}
{{Spacewalk/channel |name=CentOS 5 EPEL - i386 |label=centos5-epel-i386 |parent=CentOS 5 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 5 EPEL for i386 architecture |gpgurl=https://fedoraproject.org/static/217521F6.txt |gpgid=217521F6 |gpgfingerprint=B940 BE07 7D71 0A28 7D7F  2DD1 119C C036 2175 21F6 }}
{{Spacewalk/channel |name=CentOS 5 B2PWeb - i386 |label=centos5-b2pweb-i386 |parent=CentOS 5 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 5 B2PWeb for i386 architecture }}
 
==== Channels pour CentOS 5 64 bits ====
{{Spacewalk/channel |name=CentOS 5 Base - x86_64 |label=centos5-base-x86_64 |parent= |arch=x86_64 |checksum=sha1 |summary=CentOS 5 Base for x86_64 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 |gpgid=E8562897 |gpgfingerprint=473D 66D5 2122 71FD 51CC 17B1 A8A4 47DC E856 2897 }}
{{Spacewalk/channel |name=CentOS 5 Updates - x86_64 |label=centos5-updates-x86_64 |parent=CentOS 5 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 5 Updates for x86_64 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5 |gpgid=E8562897 |gpgfingerprint=473D 66D5 2122 71FD 51CC 17B1 A8A4 47DC E856 2897 }}
{{Spacewalk/channel |name=CentOS 5 Rpmforge - x86_64 |label=centos5-rpmforge-x86_64 |parent=CentOS 5 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 5 Rpmforge for x86_64 architecture |gpgurl=http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt |gpgid=6B8D79E6 |gpgfingerprint=EBC6 E12C 62B1 C734 026B  2122 A20E 5214 6B8D 79E6 }}
{{Spacewalk/channel |name=CentOS 5 EPEL - x86_64 |label=centos5-epel-x86_64 |parent=CentOS 5 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 5 EPEL for x86_64 architecture |gpgurl=https://fedoraproject.org/static/217521F6.txt |gpgid=217521F6 |gpgfingerprint=B940 BE07 7D71 0A28 7D7F  2DD1 119C C036 2175 21F6 }}
{{Spacewalk/channel |name=CentOS 5 B2PWeb - x86_64 |label=centos5-b2pweb-x86_64 |parent=CentOS 5 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 5 B2PWeb for x86_64 architecture }}
 
==== Channels pour CentOS 6 32 bits ====
{{Spacewalk/channel |name=CentOS 6 Base - i386 |label=centos6-base-i386 |parent=None |arch=IA-32 |checksum=sha1 |summary=CentOS 6 Base for i386 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 |gpgid=C105B9DE |gpgfingerprint=C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE }}
{{Spacewalk/channel |name=CentOS 6 Updates - i386 |label=centos6-updates-i386 |parent=CentOS 6 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 6 Updates for i386 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 |gpgid=C105B9DE |gpgfingerprint=C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE }}
{{Spacewalk/channel |name=CentOS 6 EPEL - i386 |label=centos6-epel-i386 |parent=CentOS 6 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 6 EPEL for i386 architecture |gpgurl=https://fedoraproject.org/static/0608B895.txt |gpgid=0608B895 |gpgfingerprint=8C3B E96A F230 9184 DA5C 0DAE 3B49 DF2A 0608 B895 }}
{{Spacewalk/channel |name=CentOS 6 B2PWeb - i386 |label=centos6-b2pweb-i386 |parent=CentOS 6 Base - i386 |arch=IA-32 |checksum=sha1 |summary=CentOS 6 B2PWeb for i386 architecture }}
 
==== Channels pour CentOS 6 64 bits ====
{{Spacewalk/channel |name=CentOS 6 Base - x86_64 |label=centos6-base-x86_64 |parent=None |arch=x86_64 |checksum=sha1 |summary=CentOS 6 Base for x86_64 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 |gpgid=C105B9DE |gpgfingerprint=C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE }}
{{Spacewalk/channel |name=CentOS 6 Updates - x86_64 |label=centos6-updates-x86_64 |parent=CentOS 6 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 6 Updates for x86_64 architecture |gpgurl=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 |gpgid=C105B9DE |gpgfingerprint=C1DA C52D 1664 E8A4 386D BA43 0946 FCA2 C105 B9DE }}
{{Spacewalk/channel |name=CentOS 6 EPEL - x86_64 |label=centos6-epel-x86_64 |parent=CentOS 6 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 6 EPEL for x86_64 architecture |gpgurl=https://fedoraproject.org/static/0608B895.txt |gpgid=0608B895 |gpgfingerprint=8C3B E96A F230 9184 DA5C 0DAE 3B49 DF2A 0608 B895 }}
{{Spacewalk/channel |name=CentOS 6 B2PWeb - x86_64 |label=centos6-b2pweb-x86_64 |parent=CentOS 6 Base - x86_64 |arch=x86_64 |checksum=sha1 |summary=CentOS 6 B2PWeb for x86_64 architecture }}
 
=== 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*'
  /usr/bin/spacewalk-common-channels -v -u admin -p pass -a i386,x86_64 -k unlimited 'centos5*' 'spacewalk-nightly-client*'


Ligne 63 : Ligne 104 :
== Repo-sync ==
== Repo-sync ==


Intruduced in Spacewalk 0.6, repo sync was enhanced in Spacewalk 1.1. For version 1.1 and newer proceed as following :
=== 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
 
[[Fichier:SpaceWalkRepoAdd.png|800px]]
 
==== Repository pour CentOS 5 32 bits ====
{{Spacewalk/repo|name=centos5-base-i386|url=http://mirror.centos.org/centos/5/os/i386/}}
{{Spacewalk/repo|name=centos5-updates-i386|url=http://mirror.centos.org/centos/5/updates/i386/}}
{{Spacewalk/repo|name=centos5-rpmforge-i386|url=http://apt.sw.be/redhat/el5/en/i386/rpmforge/}}
{{Spacewalk/repo|name=centos5-epel-i386|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386
{{Spacewalk/repo|name=centos5-b2pweb-i386|url=http://koji.b2pweb.com/repos/centos/5/os/RPMS/i386}}
 
==== Repository pour CentOS 5 64 bits ====
{{Spacewalk/repo|name=centos5-base-x86_64|url=http://mirror.centos.org/centos/5/os/x86_64/}}
{{Spacewalk/repo|name=centos5-updates-x86_64|url=http://mirror.centos.org/centos/5/updates/x86_64/}}
{{Spacewalk/repo|name=centos5-rpmforge-x86_64|url=http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/}}
{{Spacewalk/repo|name=centos5-epel-x86_64|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64
{{Spacewalk/repo|name=centos5-b2pweb-x86_64|url=http://koji.b2pweb.com/repos/centos/5/os/RPMS/x86_64}}


Goto Channels -> Manage Software Channels -> Manage Repositories -> create new repository
==== Repository pour CentOS 6 32 bits ====
{{Spacewalk/repo|name=centos6-base-i386|url=http://mirror.centos.org/centos/6/os/i386/}}
{{Spacewalk/repo|name=centos6-updates-i386|url=http://mirror.centos.org/centos/6/updates/i386/}}
{{Spacewalk/repo|name=centos6-epel-i386|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386
{{Spacewalk/repo|name=centos6-b2pweb-i386|url=http://koji.b2pweb.com/repos/centos/6/os/RPMS/i386}}


[[Fichier:SpaceWalkRepoSync.png|1000px|center]]
==== Repository pour CentOS 6 64 bits ====
{{Spacewalk/repo|name=centos6-base-x86_64|url=http://mirror.centos.org/centos/6/os/x86_64/}}
{{Spacewalk/repo|name=centos6-updates-x86_64|url=http://mirror.centos.org/centos/6/updates/x86_64/}}
{{Spacewalk/repo|name=centos6-epel-x86_64|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64
{{Spacewalk/repo|name=centos6-b2pweb-x86_64|url=http://koji.b2pweb.com/repos/centos/6/os/RPMS/x86_64}}


After creating the repository, you need to link it to one or more Software Channels. Goto: Channels -> Manage Software Channels -> Choose the channel to be linked -> Repositories -> Select the repositories to be linked to the channel -> Update Repositories. Now you can sync the repository clicking on the sync tab. Click on sync now or schedule a sync. If you used {{class|spacewalk-common-channels}} it has already setup repositories for you.
=== 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.


Alternatively you can start a sync of a yum repository defined in the web ui by command line:
[[Fichier:SpaceWalkRepoSync.png|800px]]
{{Admon/note|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  
  spacewalk-repo-sync --channel CHANNEL_LABEL  


You can use any repo url that is supported by yum (http://, file:///, etc...). If running the command line directly, you must be the root user.
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.


For more information also see
Voir la page <app>man</app> pour plus d'information
  man 8 spacewalk-repo-sync
  man 8 spacewalk-repo-sync


If, when doing a spacewalk-repo-sync, you get a "yum.Errors.NoMoreMirrorsRepoError" error then you need to install python-hashlib.
{{Admon/tip|Erreur "yum.Errors.NoMoreMirrorsRepoError"|Si l'erreur "yum.Errors.NoMoreMirrorsRepoError" apparait durant une synchronisation, il faut installer le paquet <package>python-hashlib</package>.}}


The logs are stored in /var/log/rhn/reposync/
Les logs se trouvent dans <path>/var/log/rhn/reposync/</path>


== rhnpush ==
== rhnpush ==

Version du 16 août 2013 à 13:39

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 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 (none)

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 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 (none)

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 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 (none)

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 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 (none)

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

{{Spacewalk/repo|name=centos5-epel-i386|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=i386


IconRepo16.pngDépôt

Repository pour CentOS 5 64 bits

IconRepo16.pngDépôt


IconRepo16.pngDépôt


IconRepo16.pngDépôt

{{Spacewalk/repo|name=centos5-epel-x86_64|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=x86_64


IconRepo16.pngDépôt

Repository pour CentOS 6 32 bits

IconRepo16.pngDépôt


IconRepo16.pngDépôt

{{Spacewalk/repo|name=centos6-epel-i386|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=i386


IconRepo16.pngDépôt

Repository pour CentOS 6 64 bits

IconRepo16.pngDépôt


IconRepo16.pngDépôt

{{Spacewalk/repo|name=centos6-epel-x86_64|url=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=x86_64


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>

rhnpush

If the packages you are wanting to push to the Spacewalk server are not in a yum repository, you can push them directly using the rhnpush tool.

For example, to upload a directory of packages called 'dir_of_packges' to the channel 'my-custom-channel':

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

Note: Make sure <path>/var/satellite</path> exists on the Spacewalk server and has owner:group apache before pushing. The -v option causes progress information to be printed, e.g.:

# 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: I found that the above failed on Fedora 9 Everything. My work around was

find . -name "*rpm" | xargs rhnpush --channel=fedora-9-i386 --server=http://localhost/APP -v --tolerant -u spacewalk -p spacewalk

Note: The directory you pass as --dir=suchandsuch HAS TO contain the RPMs. rhnpush won't descend into directories to find RPMs.

     Also, I had to put the -v at the end of the group of parameters.
       --onekopaka

Note: If you are running rhnpush from a box that is NOT your spacewalk server, use the correct hostname in the --server param

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

This script will get the yum repo information out of the database and trigger spacewalk-repo-sync for every channel that has a yum repository. You can run it from cron to sync your repositories on a regular basis.