Spacewalk Client Installation and Register with Spacewalk Server

Spacewalk Client Installation and Register with Spacewalk Server


Overview


In this article we are going to cover -

  • Install Spacewalk clients.
  • Subscribe channels for the clients.
  • Install packages from the Spacewalk server’s Channel.


Spacewalk Installation and Configuration


Please check my previous article for Spacewalk installation and configuration using the below link.

Spacewalk Installation and Configuration


Managing Spacewalk Channels and Repositories


Please check my previous article for Managing Spacewalk Channels and Repositories using the below link.

Managing Spacewalk Channels and Repositories



Install Spacewalk client


We will first configure the Spacewalk client repo on the client machine to get the latest packages and then install the below packages.

 

# rpm -Uvh http://yum.spacewalkproject.org/2.7-client/RHEL/7/x86_64/spacewalk-client-repo-2.7-2.el7.noarch.rpm

 

# rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

 

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


Now we will install the Spacewalk certificate on client machine to enable the secure communication.

# rpm -Uvh http://192.168.20.31/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm


Retrieving http://192.168.20.31/pub/rhn-org-trusted-ssl-cert-1.0-1.noarch.rpm
Preparing... ################################# [100%])
Updating / installing...
1:rhn-org-trusted-ssl-cert-1.0-1 ################################# [100%])


Note: Make sure the client machine can connect to the Spacewalk server with hostname. For that we need to add the entry in /etc/hosts file or DNS server for resolving the hostname.


Register clients with Spacewalk Server


In my previous article we have created the activation keys for registering and configuring client systems with Spacewalk server. Now login into Spacewalk server and get an activation key.

Go to System --> Activation Keys.



Copy the same key and run the below command on client machine to register it to the Spacewalk server but before that we need to download the ssl certificate from spacewalk server.


# wget -O /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT http://192.168.20.31/pub/RHN-ORG-TRUSTED-SSL-CERT


--2018-03-12 01:18:02-- http://192.168.20.31/pub/RHN-ORG-TRUSTED-SSL-CERT
Connecting to 192.168.20.31:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5232 (5.1K)
Saving to: ‘/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT’

100%[====================================================================================================================>] 5,232 --.-K/s in 0s

2018-03-12 01:18:02 (580 MB/s) - ‘/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT’ saved [5232/5232]

# rhnreg_ks --force --activationkey 1-8059632d34404a3131e5f41a1e8ac62c --serverUrl http://spacewalk-server/XMLRPC --sslCACert=/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT --profilename=spacewalk-client


Now, go to Spacewalk server dashboard and check Systems (top menu) . We can see there the client system has been registered.



We can check the client info by clicking on client name (spacewalk-client). Once we click on client name then we can see the detailed information about the registered client (spacewalk-client). We can see that the client machine has been automatically subscribed to the base channel (linuxtechiebulb_centos7).




If we want to use the child channel then we need to enable the child channel (mariadb_centos7) of the base channel (linuxtechiebulb_centos7).


Go to Systems  --> spacewalk-client  --> Software  --> Software Channels  --> Software Channel Subscriptions  --> Select the child channel (mariadb_centos7) and then click Change Subscriptions.




Now, the client system is successfully subscribed to mariadb_centos7 child channel and we can see in details.




Register Spacewalk clients from Command line


We can also register clients from the client system Terminal itself. To get all the available channels list run the below command. We have to enter username and password of Spacewalk server admin account.

Method 1)

# spacewalk-channel -L

Username: admin
Password:

mariadb_centos7
linuxtechiebulb_centos7

 

Method 2)

# rhn-channel -L

Username: admin
Password:

mariadb_centos7
linuxtechiebulb_centos7

 
 

To get all the subscribed channels list run the below command.

Method 1)

# spacewalk-channel -l

mariadb_centos7
linuxtechiebulb_centos7

 

Method 2)

# rhn-channel -l

mariadb_centos7
linuxtechiebulb_centos7


We can subscribe the child channel using below command.

Method 1)

# spacewalk-channel -a -c mariadb_centos7

Username: admin
Password:

 

Method 2)

# rhn-channel -a -c mariadb_centos7

Username: admin
Password:

 
 

If we want to remove child channel subscriptions, then run the below command.

Method 1)

# spacewalk-channel -r -c mariadb_centos7

Username: admin
Password:

 

Method 2)

# rhn-channel -r -c mariadb_centos7

Username: admin
Password:

 
 

Install Packages using Spacewalk Server


Now, our Spacewalk server and client configuration is ready. We can start to install or update packages from the Spacewalk server but first disable non-Spacewalk repositories to avoid packages being downloaded from internet.


# sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/*

 

 
 

For test, we will install the Mariadb package on the client machine.

# yum update


Output:

Loaded plugins: fastestmirror, rhnplugin
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-shared.x86_64 0:10.0.34-1.el7.centos will be obsoleting
--> Processing Dependency: MariaDB-common for package: MariaDB-shared-10.0.34-1.el7.centos.x86_64
---> Package dhclient.x86_64 12:4.2.5-58.el7.centos.1 will be updated
---> Package dhclient.x86_64 12:4.2.5-58.el7.centos.3 will be an update
---> Package dhcp-common.x86_64 12:4.2.5-58.el7.centos.1 will be updated
---> Package dhcp-common.x86_64 12:4.2.5-58.el7.centos.3 will be an update
---> Package dhcp-libs.x86_64 12:4.2.5-58.el7.centos.1 will be updated
---> Package dhcp-libs.x86_64 12:4.2.5-58.el7.centos.3 will be an update
---> Package mariadb-libs.x86_64 1:5.5.56-2.el7 will be obsoleted
---> Package tzdata.noarch 0:2018c-1.el7 will be updated
---> Package tzdata.noarch 0:2018d-1.el7 will be an update
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.0.34-1.el7.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
MariaDB-shared x86_64 10.0.34-1.el7.centos mariadb_centos7 1.2 M
replacing mariadb-libs.x86_64 1:5.5.56-2.el7
Updating:
dhclient x86_64 12:4.2.5-58.el7.centos.3 updates 282 k
dhcp-common x86_64 12:4.2.5-58.el7.centos.3 updates 174 k
dhcp-libs x86_64 12:4.2.5-58.el7.centos.3 updates 130 k
tzdata noarch 2018d-1.el7 updates 481 k
Installing for dependencies:
MariaDB-common x86_64 10.0.34-1.el7.centos mariadb_centos7 43 k

Transaction Summary
==============================================================================================================================================================
Install 1 Package (+1 Dependent package)
Upgrade 4 Packages

Total size: 2.3 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
Updating : 12:dhcp-libs-4.2.5-58.el7.centos.3.x86_64 1/11
Updating : 12:dhcp-common-4.2.5-58.el7.centos.3.x86_64 2/11
Installing : MariaDB-common-10.0.34-1.el7.centos.x86_64 3/11
Installing : MariaDB-shared-10.0.34-1.el7.centos.x86_64 4/11
Updating : 12:dhclient-4.2.5-58.el7.centos.3.x86_64 5/11
Updating : tzdata-2018d-1.el7.noarch 6/11
Cleanup : 12:dhclient-4.2.5-58.el7.centos.1.x86_64 7/11
Cleanup : 12:dhcp-common-4.2.5-58.el7.centos.1.x86_64 8/11
Cleanup : 12:dhcp-libs-4.2.5-58.el7.centos.1.x86_64 9/11
Cleanup : tzdata-2018c-1.el7.noarch 10/11
Erasing : 1:mariadb-libs-5.5.56-2.el7.x86_64 11/11
Verifying : 12:dhcp-libs-4.2.5-58.el7.centos.3.x86_64 1/11
Verifying : 12:dhcp-common-4.2.5-58.el7.centos.3.x86_64 2/11
Verifying : MariaDB-common-10.0.34-1.el7.centos.x86_64 3/11
Verifying : 12:dhclient-4.2.5-58.el7.centos.3.x86_64 4/11
Verifying : tzdata-2018d-1.el7.noarch 5/11
Verifying : MariaDB-shared-10.0.34-1.el7.centos.x86_64 6/11
Verifying : 12:dhcp-common-4.2.5-58.el7.centos.1.x86_64 7/11
Verifying : 12:dhcp-libs-4.2.5-58.el7.centos.1.x86_64 8/11
Verifying : 12:dhclient-4.2.5-58.el7.centos.1.x86_64 9/11
Verifying : tzdata-2018c-1.el7.noarch 10/11
Verifying : 1:mariadb-libs-5.5.56-2.el7.x86_64 11/11

Installed:
MariaDB-shared.x86_64 0:10.0.34-1.el7.centos

Dependency Installed:
MariaDB-common.x86_64 0:10.0.34-1.el7.centos

Updated:
dhclient.x86_64 12:4.2.5-58.el7.centos.3 dhcp-common.x86_64 12:4.2.5-58.el7.centos.3 dhcp-libs.x86_64 12:4.2.5-58.el7.centos.3 tzdata.noarch 0:2018d-1.el7

Replaced:
mariadb-libs.x86_64 1:5.5.56-2.el7

Complete!

 

 
 

Now we can see that the packages have been installed from Spacewalk child channel (mariadb_centos7).

That’s all for now. In my upcoming article, we’ll cover:

  • Run remote command.
  • Deploy file through Spacewalk.


Next Article: Running Remote commands and Managing Files via Spacewalk


Leave a Reply

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