This is the third part of Spacewalk installation and configuration series. In the first two parts, we gone through how to install and configure Spacewalk server and managing Spacewalk channels and repositories.
In this tutorial, we will configure clients to take installation packages from the Spacewalk server by registering it with Spacewalk server.
Article will continue after the ad
OS : CentOS Linux release 7.0.1406 (Core)
Hostname : client.itzgeek.local
IP Address : 192.168.12.4
Install Spacewalk clients:
CentOS Base repository does not have packages that are required for registering clients with Spacewalk server, so we would need to configure Spacewalk repo on client machine.
# rpm -Uvh http://yum.spacewalkproject.org/2.3-client/RHEL/7/x86_64/spacewalk-client-repo-2.3-2.el7.noarch.rpm
Install below package.
# yum install yum-rhn-plugin
Once the packages are installed, try to register the clients with spacewalk server.
Register clients with SpaceWalk Server:
It is recommended to use activation keys for registering and configuring client systems with Spacewalk server.
Now, login to Spacewalk server and get an activation that we created in previous tutorial.
Goto System –> Activation Keys.
On client system’s Terminal, run the following command to register it to the Spacewalk server.
# rhnreg_ks --activationkey 1-3de95eb8d397e65b3831910fdc3e3f61 --serverUrl https://server.itzgeek.local/XMLRPC
Once the above command is executed, goto Spacewalk console, and click on Systems. You will see our client system that we just registered with Spacewalk.
Click on client name, you will be taken to client summary page where you can see detailed information about registered client (client.itzgeek.local). You can see that this system has subscribed automatically to base channel (itzgeek_centos7).
Modifying Subscription (Optional):
If you want to make a use of child channels (Ex. To install Nginx), To enable the child channels of the base channel to get Niginx packages.
Go to Systems –> <Your Client> –> Software –> Software Channels –> Software Channel Subscriptions.
Click on Alter Subscription Channels on client over page.
Select the Child channels (Ex. nginx_centos7) and click Change Subscriptions.
Now, client system is successfully subscribed to Nginx child channel.
Command Line Mode:
You can also change channel subscription using command Line. To list subscribed channels, run.
# rhn-channel -l
To list the available channels, run.
# rhn-channel -L
Username: itzgeek Password: nginx_centos7
Now, to subscribe to child channel, run.
# rhn-channel -a -c nginx_centos7
You will have to enter username and password of Spacewalk server admin account.
Veryify the subscription using below command.
# rhn-channel -l
If you want to remove child channel subscriptions, run the following command.
# rhn-channel -r -c nginx_centos7
That’s it. You can start to install or update packages from the Spacewalk server. Also, make sure that you have disabled non-Spacewalk repositories.
To do that, run:
# sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*
To test, install Nginx package on client machine.
# yum install nginx
Loaded plugins: fastestmirror, rhnplugin This system is receiving updates from RHN Classic or Red Hat Satellite. Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package nginx.x86_64 1:1.8.0-1.el7.ngx will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: nginx x86_64 1:1.8.0-1.el7.ngx nginx_centos7 369 k Transaction Summary ================================================================================ Install 1 Package Total download size: 369 k Installed size: 889 k Is this ok [y/d/N]: [...]
If you see the above output, the packages are installed from Spacewalk child channel (nginx_centos7).
That’s All. You have successfully registered client systems with Spacewalk server for packages.I plan to cover more topics on Spacewalk server, stay tuned.