Quick Guide for Spacewalk

Quick Guide for Spacewalk is an open source (GPLv2) Linux systems management solution. It is the upstream community project from which the Red Hat Network Satellite product is derived. According to spacewalk definition it provides

  • Inventory your systems (hardware and software information)
  • Install and update software on your systems
  • Collect and distribute your custom software packages into manageable groups
  • Provision (kickstart) your systems
  • Manage and deploy configuration files to your systems
  • Monitor your systems
  • Provision virtual guests
  • Start/stop/configure virtual guests
  • Distribute content across multiple geographical sites in an efficient manner

It  manages software content updates for Red Hat derived distributions such as Fedora, CentOS, and Scientific Linux, within your firewall. Limited support for Debian is also available. Spacewalk allows administrators to efficiently manage the systems on their network. Through a simple user interface, administrators can perform patch management, updates, monitoring, and maintenance. And because Spacewalk is Web-based, it can be accessed from anywhere. Quick Guide for Spacewalk or Proxy server options provide advanced capabilities and the ability to get updates directly from Red Hat with even greater levels of security and reduced network bandwidth. As I mentioned already spacewalk is the upstream project of Redhat Network Satellite (RHN). The Changes will occur frequenty in the Spacewalk project to fulfill this mission of having the latest technology. However, if your needs require stability and support over access to the latest management technology, you may decide that a Satellite subscription is right for you.

Creating Channels

1. Create a base channel within Spacewalk.

Channels > Manage Software Channels > Create New Channel

2. Fill up all the required fields such as Channel Name, Channel Label, and Channel Summary

3. Select the Parent (its depends upon your channel)

4. Select the channel architecture from the drop down list

5. Select the Checksum type

6. Write a description about your channel

7. Fill the Contact support information, Channel access control and security GPG

8. Now click the “Create Channel” button.

The channel with the specified name has been created.

Creating activation key

Activation keys are used to register a system to spacewalk server. System registered with an activation key will inherit the characteristics defined by that key.

1. To create an activation key

Systems > Activation keys > Create new key

2. Enter the description of the activation key

3. If you have a specific key value, type it in the key textbox else leave it as blank. Spacewalk will generate a key after clicking create key button.

4. Enter a numeric value for the limited usage of the key. In case if you want to use the key unlimited times leave the usage textbox as blank.

5. Select the base channel from the drop down list box or choose “Quick Guide for Spacewalk Default” to allow systems to register to the default Red Hat provided channel that corresponds to their installed version of Red Hat Enterprise Linux.

6. Enable the universal default check box and click “Create Activation Key”

Registering Clients

Install the client-tools in the client

For RHEL 5 / CentOS 5

# rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/5/i386/spacewalk-client-repo-1.7-5.el5.noarch.rpm

For CentOS 6

# rpm -Uvh http://spacewalk.redhat.com/yum/1.7/RHEL/6/i386/spacewalk-client-repo-1.7-5.el6.noarch.rpm

To register the client host, you need to install the client registration tools. But those tools are not avail in the redhat repository. You can found those packages in EPEL repository

For RHEL 5 / CebtOS 5

# BASEARCH=$(uname -i)# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/$BASEARCH/epel-release-5-4.noarch.rpm

For CentOS 6

# BASEARCH=$(uname -i)# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/$BASEARCH/epel-release-6-5.noarch.rpm

Now install the client packages

# yum install rhn-client-tools rhn-check rhn-setup rhnsd m2crypto yum-rhn-plugin

Register your CentOS or Red Hat Enterprise Linux system to Quick Guide for Spacewalk using the activation key you created earlier

# rhnreg_ks --serverUrl=http://YourSpacewalk.example.org/XMLRPC --activationkey=<key-with-rhel-custom-channel>

rhnreg_ks is used for registration of clients to Spacewalk. If you need to re-register a client to your Spacewalk server or change registration from one environment or server to another Spacewalk server then use the “–force” flag with rhnreg_ks, otherwise there is no need to use “–force”.

Adding packages to repository

There are two ways to add packages to the Quick Guide for Spacewalk server. We can either add using spacewalk-repo-sync or rhnpush command.

Spacewalk-repo-sync

The  spacewalk-repo-sync tool is used to sync packages from external or local yum repositories. All the packages within the specified repository will be added to the channel.Any url supported by yum is supported by this utility, including mirror lists.  If the url is not supplied, the tool will look to see what  repositories are associated with the specified channel and use those.

Example

spacewalk-repo-sync --channel=repo1 --url=http://example.com/yum-repo/
spacewalk-repo-sync --channel=repo2 --url=file:///var/share/localrepo/
spacewalk-repo-sync --channel=repom --url=http://example.com/mirrorlist.xml/

You can also use WebGUI and this is the easiest way to create repositories

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

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 by clicking on the sync tab.

Click on sync now or schedule a sync.

RHNpush

The  RHN  Satellite Package Pusher (rhnpush) pushes RPMs into locally managed channels on an RHN Satellite Server. Rhnpush has three configuration files called /etc/sysconfig/rhn/rhnpushrc, ~/.rhnpushrc, and ./.rhnpushrc.

/etc/sysconfig/rhn/rhnpushrc is the system-wide default settings for rhnpush.
~/.rhnpushrc is the user-specific settings that override the system-wide settings.
./.rhnpushrc controls the directory specific settings that override the user-specific and system-specific settings.

/etc/sysconfig/rhn/rhnpushrc must be present for rhnpush to function correctly. If it is missing, rhnpush will attempt to use a series of  default  settings  stored  internally as a replacement. ~/.rhnpushrc and ./.rhnpushrc are not required to be present, but will be used if they are present. They are not created automatically by rhnpush.

Rhnpush uses a cache, stored at ~/.rhnpushcache, to temporarily hold the username and password for a user. If the cache is missing, it will be created by rhnpush.
If the cache is present and not too old, the usename-password combo will be used as a convenience for the user. The amount of time a cache lasts is configurable in any of the three configuration files. If your username/password combination gets messed up you have two options. One, you can wait until the cache expires, which takes  minutes  by  default. Two, you can use the –new_cache option to force rhnpush to let you reenter your username/password.

Using  the  –stdin  and –dir options at the same time works as follows: rhnpush will let you type in rpm names, each rpm name on a separate line. When       you have finished entering in rpm names, hit Ctrl-D. Rhnpush will then grab the files from directory you specified with –dir, put them in a  list  with       the rpms you listed through standard input, and send them to the channel that was listed on the command-line or in the configuration files.

Note : Make sure /var/satellite exists on the Spacewalk server and has owner:group apache before pushing.

[root@sathishhost ~]# chgrp apache /var/satellite/ -R

[root@sathishhost ~]# ls -l /var | grep satellite

drwxr-xr-x.  3 apache apache 4096 Mar 20 10:06 satellite

Example

rhnpush --server localhost -u <username> -p <password> --channel <channel-name> /usr/local/src/additional/*.rpm

rhnpush --server localhost -u sathish -p redhat --channel spacewalk-nightly-rhel-6-x86_64 /usr/local/src/additional/*.rpm

rhnpush -v --channel=<channel-name> --server=http://localhost/APP --dir=<package-dir>

rhnpush -v --channel=spacewalk-nightly-rhel-6-x86_64 --server=http://localhost/APP --dir=/usr/local/src/additional

Leave a Reply

Your email address will not be published. Required fields are marked *