This is the continuation from installing and Configuring SpaceWalk on CentOS 7. This tutorial will show you how to configure Spacewalk to distribute updates for CentOS or RHEL clients.This is a simple step by step process, so i will only mention minimal settings to be done for distributing updates.
Spacewalk Channels:
Channel is nothing but a collection of software packages. A channel may contain packages from a specific distribution, also it may contain packages for an application or family of applications. Users may also define channels.
Any client can subscribe to a particular channel to download, update, install packages. The channels are linked to upstream server (a normal YUM repository). A channel may have linked to multiple repositories, can be cloned, sync or customized.
There are two types of channels:
1.Base channels
2. Child channels
A base channel consists of packages based on a specific architecture and Red Hat Enterprise Linux release. A child channel is a channel associated with a base channel that contains extra packages. A system must be subscribed to only one base channel. A system can be subscribed to multiple child channels of its base channel. A subscribed system can only install or update packages available through its Satellite channels.
Create a Base Channel:
Login to Spacewalk web console, https://spacewalk-server-ip. Enter user name and password that you defined in previous tutorial.
Goto Channels –> Manage Software Channels –> Create New Channel.
This is where you can label your different type of architecture. Here i created label “itzgeek_centos7” for CentOS 7 packages, same like you can create label for other architectures and other Linux flavors, label name does not matter; only architecture is important while configuring.
Create a repository:
Goto Channels –> Manage Software Channels –> Manage Repositories –> Create repository.
Here you can mention upstream server from where Spacewalk server will download the updated packages for clients. To show you a demo, i used http://mirror.supremebytes.com/centos/7/os/x86_64/as Repository URL. This repository URL is one of CentOS mirror, you can find more mirrors here.
Assigning a repository to Base channel:
Goto Channels –> Manage Software Channels –> Select the created channel (itzgeek_centos7) –> Repository –> Select the previously created repository –> Update repository.
Now its time to sync packages from upstream server, Go to Channels –> Manage Software Channels –> Select the created channel –> Repository –> Sync –> Sync Now.
or
Run below command to sync with upstream server.
# /usr/bin/spacewalk-repo-sync --channel itzgeek_centos7 --type yum
You can go through sync logs to troublehoot any issues arise during the synchronization.
# cat /var/log/rhn/reposync/reponame.log
Note: The packages will be downloaded from the upstream server will be kept in /var/satellite/ folder of your Spacewalk server. Make sure you have enough space in /var/satellite/ folder.
Once the package synchronization is completed, you can list the packages by going to Channels –> Manage Software Channels –> Select your channel –> Packages –> List / Remove.
Create Activation Key:
Goto Systems –> Activation Keys –> Create New Key.
Here you can create a activation keys for client subscription, in this page you need to select the base channel ( itzgeek_centos7).
Whenever any client uses this key, the client machine will be automatically subscribed to the created channel. You can create multiple keys; in case you would like to use multiple channels.
Note: Better to leave the key blank for automatic generation.
You can get a list of activation key by going to Systems –> Activation Keys.
Creat a Child Channel:
Goto Channels –> Manage Software Channels –> Create New Channel. Enter the Child channel name, label, Parent channel, Architecture, and Channel description etc. Here you must select the Parent channel from the drop down list. Finally, click Create Channel button.
Creat a Repository for Child Channel:
Goto Channels –> Manage Software Channels –> Manage Repositories –> Create repository.
Let us create a Nginx repository, Enter the repository name and actual URL.
You can create your own repository.
Assigning a repository to Child channel:
Goto Channels –> Manage Software Channels –> Select the child channel.
Goto Repository (TAB) –> Select the created repository (Nginx) –> Update repository.
In same page, goto Sync (TAB) –> Sync Now or Select a schedule.
or
Run below command.
/usr/bin/spacewalk-repo-sync --channel nginx_centos7 --type yum
You can go through sync logs to troubleshoot any issues arise during the synchronization.
# cat /var/log/rhn/reposync/reponame.log
At this stage your Spacewalk server is almost ready to serve packages to the clients.
That’s all. The next tutorial will be on configuring client to use Spacewalk server for updates.