Technology Blog

Howto Setup SpaceWalk System Management in CentOS / RHEL 7.X

0

Spacewalk is a free and open source Linux systems management software developed by Red Hat and maintained by its active community. It was the upstream version of the Red Hat Satellite which got open sourced in 2008. Spacewalk includes a beautiful web interface with powerful back-end, Red Hat Proxy Server and its associated client software of Red Hat Satellite. It uses PostgreSQL to store its necessary data and uses it as default database system. It is released under the GNU General Public License version 2 by its community and developers. Unlike Satellite, it is fully community-driven and support several other linux distributions like Fedora, CentOS, SuseLinux, Debian and their derivatives. Some of the major features of Spacewalk are listed as follows.

  • It provides information of hardware and software in our system.
  • It makes install and update of software easy in our system.
  • It helps to collect and distribute our custom software packages into manageable groups.
  • It provisions kickstart deployment our system.
  • Managing and deploying configuration files is easy with spacewalk.
  • It has the capacity to start, stop and configure virtual guests like Xen, KVM.

Here are some easy steps on how we can setup Spacewalk completely in our machine running CentOS 7 or RHEL 7.

1. Installing EPEL Repo

First of all, we’ll install the EPEL repository into our linux machine so that the Java Virtual Machine package v 1.6 or greater and other dependencies required by spacewalk will be installed from the EPEL repository while installing it. It also contains the necessary version of openjdk which is required by spacewalk. To install EPEL in our CentOS 7 or RHEL 7, we’ll need to run the following command in a terminal or console under sudo/root access using rpm package manager.

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

Retrieving https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
warning: /var/tmp/rpm-tmp.mvB2nT: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:epel-release-7-5 ################################# [100%]

2. Adding JPackage Repo

Next, we’ll need to install JPackage repository so that all the necessary java packages for spacewalk will be installed. It is strongly recommended to install it before installing Spacewalk in our centos or rhel machine. To add JPackage repository, we’ll create a new file named jpackage-generic.repo under /etc/yum.repos.d/ directory and add the required configuration using a text editor.

# vi /etc/yum.repos.d/jpackage-generic.repo

We’ll now add the following lines of configuration for our jpackage repository then, we’ll simply save and exit the file.

[jpackage-generic]
name=JPackage generic
#baseurl=http://mirrors.dotsrc.org/pub/jpackage/5.0/generic/free/
mirrorlist=http://www.jpackage.org/mirrorlist.php?dist=generic&type=free&release=5.0
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc

Adding Jpackage Repo

Here, we’re adding the repository of JPackage version 5.0 which is generic release.

3. Setting up Spacewalk Repo

We’ll need to add the official yum repository of Spacewalk so that we can easily install spacewalk and its required dependencies from the repository. Here in this tutorial, we’ll install the latest release of spacewalk ie 2.3 so, we’ll gonna install the repository of the respective version ie 2.3. To install the repository, we’ll need to install an rpm file which can be installed by running the following command in a terminal or console.

# rpm -Uvh http://yum.spacewalkproject.org/2.3/RHEL/7/x86_64/spacewalk-repo-2.3-4.el7.noarch.rpm

Retrieving http://yum.spacewalkproject.org/2.3/RHEL/7/x86_64/spacewalk-repo-2.3-4.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.SsWo0p: Header V3 RSA/SHA1 Signature, key ID 066e5810: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:spacewalk-repo-2.3-4.el7 ################################# [100%]

4. Installing a Database server

Next, we’ll need to install a database server so that spacewalk can store data and information into it. There are several options on database servers that spacewalk can be used with. But PostgrelSQL is the most popular and easy to install database system for spacewalk. As Spacewalk contains an embedded postgresql database server, we’ll simply install it. To do so, we’ll need to run the following yum command.

# yum install spacewalk-setup-postgresql

5. Installing Spacewalk

After our database server with default spacewalk configuration has been setup, we’ll now finally install spacewalk in our CentOS or RHEL machine. As we have installed postgresql for database purpose, we’ll now run the following yum command to install spacewalk.

# yum install spacewalk-postgresql

6. Configuring Spacewalk

Now we’ll configure our spacewalk installation to make it work. As we are installing spacewalk with postgresql as database server, we’ll simply run the default command to configure spacewalk. To configure spacewalk, we’ll need to run the following command.

# spacewalk-setup –disconnected

** Database: Setting up database connection for PostgreSQL backend.
** Database: Installing the database:
** Database: This is a long process that is logged in:
** Database: /var/log/rhn/install_db.log
*** Progress: ###
** Database: Installation complete.
** Database: Populating database.
*** Progress: ############################
* Configuring tomcat.
* Setting up users and groups.
** GPG: Initializing GPG and importing key.
** GPG: Creating /root/.gnupg directory
You must enter an email address.
Admin Email Address? [email protected]
* Performing initial configuration.
* Activating Spacewalk.
** Loading Spacewalk Certificate.
** Verifying certificate locally.
** Activating Spacewalk.
* Configuring apache SSL virtual host.
Should setup configure apache’s default ssl server for you (saves original ssl.conf) [Y]? y
** /etc/httpd/conf.d/ssl.conf has been backed up to ssl.conf-swsave
* Configuring jabberd.
* Creating SSL certificates.
CA certificate password?
Re-enter CA certificate password?
Organization? Linoxide
Organization Unit [centos]? Linux
Email Address [[email protected]]?
City? Dublin
State? Leinster
Country code (Examples: “US”, “JP”, “IN”, or type “?” to see a list)? IE
** SSL: Generating CA certificate.
** SSL: Deploying CA certificate.
** SSL: Generating server certificate.
** SSL: Storing SSL certificates.
* Deploying configuration files.
* Update configuration in database.
* Setting up Cobbler..
Cobbler requires tftp and xinetd services be turned on for PXE provisioning functionality. Enable these services [Y]?
* Restarting services.
Installation complete.
Visit https://centos to create the Spacewalk administrator account.

7. Allowing Firewall

As spacewalk consists of a web based interface, it needs to be accessible from a web browser connected to the internet. To do so, we’ll need to allow http port 80 and https port 443 from the firewall program. As firewalld is the default firewall program in CentOS 7 and RHEL 7, we’ll need to simply run the following firewall-cmd command to allow those two protocols.

# firewall-cmd –permanent –add-service=http
# firewall-cmd –permanent –add-service=https

Then, we’ll need to reload the firewall daemon to apply the changes.

# firewall-cmd –reload

8. Web Installation

Finally, we’ll now navigate to our Spacewalk web interface by pointing our web browser to https://server.domain.com or https://ip-address/ according to our configuration. As the web interface of spacewalk uses SSL/TLS for web security, we may get some warning regarding the certificate as we’re using a self-signed SSL certificate in this tutorial. After confirming the certificate, we’ll see a web page of Spacewalk as shown below.

Creating Spacewalk User

Then, we’ll be asked to create a new administrative user and assign a desired password for that user. Then, we’ll be asked to enter our name and email address. After entering the required information, we’ll simply click on Create Login button. That will create a new user with the required information and lead towards the dashboard of spacewalk.

Spacewalk Dashboard

Conclusion

Spacewalk is pretty easy to setup as we have done in this tutorial. It is a very powerful tool developed by its active community. As its a software maintained by its community, it doesn’t have a commercial support as there is with Red Hat Satellite but the support is awesome by the spacewalk community. The machine should have 2 GB RAM as recommended but can be installed in the machine with 1 GB RAM too. It is recommended to install Spacewalk in the server which has resolvable fully-qualified domain name (FQDN) such as ‘sub.domain.com’ to make component working as expected. The web interface of spacewalk is very neat and clean with a well managed options and menus.  If you have any questions, suggestions, feedback please write them in the comment box below so that we can improve or update our contents. Thank you !