Spacewalk 2.7 Installation Steps

7 minute read

Hello folks, good morning

Today I’ll post the new steps to implement your own Spacewalk on the scenario below

  • CentOS 7.5
  • Spacewalk 2.7

So let’s do it.

Stopping firewall services

systemctl stop firewalld
systemctl disable firewalld

Changing the SELINUX to permissive mode

sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
setenforce 0

Adding the entry on the /etc/hosts file “if you have already DNS configured, just skip this step”

[root@spacewalk ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.100.230	spacewalk.local.domain	spacewalk
[root@spacewalk ~]#

Installing some packages that will help you during the configuration / management

yum install vim -y
yum install man -y
yum install wget -y
yum install createrepo -y
yum install openssh-clients -y

Installing the Spacewalk 2.7 repo package

rpm -Uvh http://copr-be.cloud.fedoraproject.org/archive/spacewalk/2.7/RHEL/7/x86_64/spacewalk-repo-2.7-2.el7.noarch.rpm

Installing the EPEL repo package

rpm -Uvh http://dl.fedoraproject.org/pub/epel/7Server/x86_64/Packages/e/epel-release-7-11.noarch.rpm

Configuring the repo related to Java packages

cat > /etc/yum.repos.d/group_spacewalkproject-java-packages-epel-7.repo << EOF
[group_spacewalkproject-java-packages]
name=Copr repo for java-packages owned by @spacewalkproject
baseurl=https://copr-be.cloud.fedoraproject.org/results/@spacewalkproject/java-packages/epel-7-\$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://copr-be.cloud.fedoraproject.org/results/@spacewalkproject/java-packages/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1
EOF

Checking the actual scenario / repositories available on the CentOS Server

[root@spacewalk yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.esecuredata.com
 * epel: mirrors.cat.pdx.edu
 * extras: muug.ca
 * updates: mirror.csclub.uwaterloo.ca
repo id                                                                        repo name                                                                                 status
base/7/x86_64                                                                  CentOS-7 - Base                                                                            9,911
epel/x86_64                                                                    Extra Packages for Enterprise Linux 7 - x86_64                                            12,581
extras/7/x86_64                                                                CentOS-7 - Extras                                                                            305
group_spacewalkproject-java-packages/x86_64                                    Copr repo for java-packages owned by @spacewalkproject                                       211
spacewalk/x86_64                                                               Spacewalk                                                                                    117
updates/7/x86_64                                                               CentOS-7 - Updates                                                                           654
repolist: 23,779
[root@spacewalk yum.repos.d]#  

Installing the package related to the Postgres DB / Spacewalk

yum install spacewalk-setup-postgresql -y

Installing the package Spacewalk package

yum install spacewalk-postgresql -y

Using one template “answer file”

cp /usr/share/doc/spacewalk-setup-2.7.12/answers.txt ~

Edit the file after copy

vim ~/answers.txt

Below one example of my conf file, simple information and the info related to the Oracle db commented

[root@spacewalk ~]# cat ~/answers.txt 
admin-email = root@localhost
ssl-set-org = ACME Company
ssl-set-org-unit = IT
ssl-set-city = Burnaby
ssl-set-state = BC
ssl-set-country = CA
ssl-password = redhat
ssl-set-email = [email protected]
ssl-config-sslvhost = Y
#db-backend=oracle
#db-user=foo
#db-password=bar
#db-name=service_name.world
#db-host=hostname.of.your.db
#db-port=1521
enable-tftp=Y
[root@spacewalk ~]# 

Step below is necessary because of a BZ [1], on the SW 2.8 will not be necessary anymore

postgresql-setup initdb

Start the installation in mode non interactive, just passing the response file

spacewalk-setup --answer-file=/root/answers.txt

Installation proceed until the end

[root@spacewalk ~]# spacewalk-setup --answer-file=/root/answers.txt
* Loading answer file: /root/answers.txt.
* Setting up SELinux..
** Database: Setting up database connection for PostgreSQL backend.
Database "rhnschema" does not exist
** 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
* Performing initial configuration.
* Configuring apache SSL virtual host.
** /etc/httpd/conf.d/ssl.conf has been backed up to ssl.conf-swsave
* Configuring jabberd.
* Creating SSL certificates.
Cname alias of the machine (comma seperated)? 
** 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..
* Restarting services.
Installation complete.  
Visit https://spacewalk.local.domain to create the Spacewalk administrator account.
[root@spacewalk ~]#

At this point, just access the url https://spacewalk.local.domain to create the admin account and use.

Below the output of spacewalk-service status just to check the Spacewalk health

[root@spacewalk ~]# spacewalk-service status
Redirecting to /bin/systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:05:50 EDT; 49s ago
  Process: 3612 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited, status=0/SUCCESS)
  Process: 3633 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=0/SUCCESS)
  Process: 3628 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 3636 (postgres)
   CGroup: /system.slice/postgresql.service
           ├─3636 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
           ├─3637 postgres: logger process   
           ├─3639 postgres: checkpointer process   
           ├─3640 postgres: writer process   
           ├─3641 postgres: wal writer process   
           ├─3642 postgres: autovacuum launcher process   
           ├─3643 postgres: stats collector process   
           ├─3737 postgres: rhnuser rhnschema 127.0.0.1(56886) idle
           ├─3738 postgres: rhnuser rhnschema 127.0.0.1(56888) idle
           ├─3739 postgres: rhnuser rhnschema 127.0.0.1(56890) idle
           ├─3740 postgres: rhnuser rhnschema 127.0.0.1(56892) idle
           ├─3741 postgres: rhnuser rhnschema 127.0.0.1(56894) idle
           ├─3864 postgres: rhnuser rhnschema [local] idle
           ├─4038 postgres: rhnuser rhnschema 127.0.0.1(56904) idle
           ├─4039 postgres: rhnuser rhnschema 127.0.0.1(56906) idle
           ├─4040 postgres: rhnuser rhnschema 127.0.0.1(56908) idle
           ├─4048 postgres: rhnuser rhnschema 127.0.0.1(56910) idle
           ├─4049 postgres: rhnuser rhnschema 127.0.0.1(56912) idle
           ├─4050 postgres: rhnuser rhnschema 127.0.0.1(56914) idle
           ├─4051 postgres: rhnuser rhnschema 127.0.0.1(56916) idle
           ├─4052 postgres: rhnuser rhnschema 127.0.0.1(56918) idle
           ├─4054 postgres: rhnuser rhnschema 127.0.0.1(56920) idle
           ├─4058 postgres: rhnuser rhnschema 127.0.0.1(56926) idle
           ├─4111 postgres: rhnuser rhnschema 127.0.0.1(56930) idle
           ├─4112 postgres: rhnuser rhnschema 127.0.0.1(56932) idle
           ├─4113 postgres: rhnuser rhnschema 127.0.0.1(56934) idle
           ├─4114 postgres: rhnuser rhnschema 127.0.0.1(56936) idle
           ├─4115 postgres: rhnuser rhnschema 127.0.0.1(56938) idle
           └─4155 postgres: rhnuser rhnschema 127.0.0.1(56942) idle

Jun 12 10:05:49 spacewalk.local.domain systemd[1]: Starting PostgreSQL database server...
Jun 12 10:05:50 spacewalk.local.domain systemd[1]: Started PostgreSQL database server.
Redirecting to /bin/systemctl status jabberd.service
● jabberd.service - Jabber Server
   Loaded: loaded (/usr/lib/systemd/system/jabberd.service; enabled; vendor preset: disabled)
   Active: active (exited) since Tue 2018-06-12 10:05:51 EDT; 49s ago
  Process: 3658 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 3658 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/jabberd.service

Jun 12 10:05:51 spacewalk.local.domain systemd[1]: Starting Jabber Server...
Jun 12 10:05:51 spacewalk.local.domain systemd[1]: Started Jabber Server.
Redirecting to /bin/systemctl status tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
   Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:05:51 EDT; 49s ago
 Main PID: 3668 (java)
   CGroup: /system.slice/tomcat.service
           └─3668 /usr/lib/jvm/jre/bin/java -ea -Xms256m -Xmx256m -Djava.awt.headless=true -Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser -Dorg.apache.tomcat.util...

Jun 12 10:06:03 spacewalk.local.domain server[3668]: Jun 12, 2018 10:06:03 AM org.apache.catalina.startup.HostConfig deployDescriptor
Jun 12 10:06:03 spacewalk.local.domain server[3668]: INFO: Deployment of configuration descriptor /etc/tomcat/Catalina/localhost/rhn.xml has finished in 12,263 ms
Jun 12 10:06:04 spacewalk.local.domain server[3668]: Jun 12, 2018 10:06:04 AM org.apache.coyote.AbstractProtocol start
Jun 12 10:06:04 spacewalk.local.domain server[3668]: INFO: Starting ProtocolHandler ["http-bio-127.0.0.1-8080"]
Jun 12 10:06:04 spacewalk.local.domain server[3668]: Jun 12, 2018 10:06:04 AM org.apache.coyote.AbstractProtocol start
Jun 12 10:06:04 spacewalk.local.domain server[3668]: INFO: Starting ProtocolHandler ["ajp-bio-127.0.0.1-8009"]
Jun 12 10:06:04 spacewalk.local.domain server[3668]: Jun 12, 2018 10:06:04 AM org.apache.coyote.AbstractProtocol start
Jun 12 10:06:04 spacewalk.local.domain server[3668]: INFO: Starting ProtocolHandler ["ajp-bio-0:0:0:0:0:0:0:1-8009"]
Jun 12 10:06:04 spacewalk.local.domain server[3668]: Jun 12, 2018 10:06:04 AM org.apache.catalina.startup.Catalina start
Jun 12 10:06:04 spacewalk.local.domain server[3668]: INFO: Server startup in 12362 ms
Redirecting to /bin/systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:06:04 EDT; 35s ago
     Docs: man:httpd(8)
           man:apachectl(8)
 Main PID: 3842 (httpd)
   Status: "Total requests: 4; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─3842 /usr/sbin/httpd -DFOREGROUND
           ├─3843 /usr/sbin/httpd -DFOREGROUND
           ├─3844 /usr/sbin/httpd -DFOREGROUND
           ├─3845 /usr/sbin/httpd -DFOREGROUND
           ├─3846 /usr/sbin/httpd -DFOREGROUND
           ├─3848 /usr/sbin/httpd -DFOREGROUND
           ├─3849 /usr/sbin/httpd -DFOREGROUND
           ├─3850 /usr/sbin/httpd -DFOREGROUND
           └─3851 /usr/sbin/httpd -DFOREGROUND

Jun 12 10:06:04 spacewalk.local.domain systemd[1]: Starting The Apache HTTP Server...
Jun 12 10:06:04 spacewalk.local.domain systemd[1]: Started The Apache HTTP Server.
Redirecting to /bin/systemctl status osa-dispatcher.service
● osa-dispatcher.service - OSA Dispatcher daemon
   Loaded: loaded (/usr/lib/systemd/system/osa-dispatcher.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:06:05 EDT; 35s ago
  Process: 3861 ExecStart=/usr/sbin/osa-dispatcher --pid-file /var/run/osa-dispatcher.pid (code=exited, status=0/SUCCESS)
  Process: 3860 ExecStartPre=/bin/rm -f /var/run/osa-dispatcher.pid (code=exited, status=0/SUCCESS)
 Main PID: 3865 (osa-dispatcher)
   CGroup: /system.slice/osa-dispatcher.service
           └─3865 /usr/bin/python -s /usr/sbin/osa-dispatcher --pid-file /var/run/osa-dispatcher.pid

Jun 12 10:06:04 spacewalk.local.domain systemd[1]: Starting OSA Dispatcher daemon...
Jun 12 10:06:05 spacewalk.local.domain systemd[1]: Started OSA Dispatcher daemon.
Redirecting to /bin/systemctl status rhn-search.service
● rhn-search.service - Spacewalk search engine
   Loaded: loaded (/usr/lib/systemd/system/rhn-search.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:06:05 EDT; 34s ago
  Process: 3875 ExecStart=/usr/sbin/rhn-search start (code=exited, status=0/SUCCESS)
 Main PID: 3888 (rhnsearchd)
   CGroup: /system.slice/rhn-search.service
           ├─3888 /usr/bin/rhnsearchd /usr/share/rhn/config-defaults/rhn_search_daemon.conf wrapper.pidfile=/var/run/rhn-search.pid wrapper.daemonize=TRUE
           └─3890 /usr/bin/java -Djava.library.path=/usr/lib:/usr/lib64:/usr/lib/oracle/11.2/client/lib:/usr/lib/oracle/11.2/client64/lib:/usr/lib/gcj/postgresql-jdbc:/usr/...

Jun 12 10:06:05 spacewalk.local.domain systemd[1]: Starting Spacewalk search engine...
Jun 12 10:06:05 spacewalk.local.domain rhn-search[3875]: Starting rhn-search...
Jun 12 10:06:05 spacewalk.local.domain systemd[1]: Started Spacewalk search engine.
● cobblerd.service - LSB: daemon for libvirt virtualization API
   Loaded: loaded (/etc/rc.d/init.d/cobblerd; bad; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:06:06 EDT; 33s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3917 ExecStart=/etc/rc.d/init.d/cobblerd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/cobblerd.service
           └─3933 /usr/bin/python -s /bin/cobblerd --daemonize

Jun 12 10:06:05 spacewalk.local.domain systemd[1]: Starting LSB: daemon for libvirt virtualization API...
Jun 12 10:06:06 spacewalk.local.domain cobblerd[3917]: Starting cobbler daemon: [  OK  ]
Jun 12 10:06:06 spacewalk.local.domain systemd[1]: Started LSB: daemon for libvirt virtualization API.
Redirecting to /bin/systemctl status taskomatic.service
● taskomatic.service - Taskomatic
   Loaded: loaded (/usr/lib/systemd/system/taskomatic.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-06-12 10:06:07 EDT; 33s ago
  Process: 3945 ExecStart=/usr/sbin/taskomatic start (code=exited, status=0/SUCCESS)
 Main PID: 3958 (taskomaticd)
   CGroup: /system.slice/taskomatic.service
           ├─3958 /usr/bin/taskomaticd /usr/share/rhn/config-defaults/rhn_taskomatic_daemon.conf wrapper.pidfile=/var/run//taskomatic.pid wrapper.daemonize=TRUE
           └─3961 /usr/bin/java -Dibm.dst.compatibility=true -Dfile.encoding=UTF-8 -Xms256m -Xmx1024m -Djava.library.path=/usr/lib:/usr/lib64:/usr/lib/oracle/11.2/client64/...

Jun 12 10:06:06 spacewalk.local.domain systemd[1]: Starting Taskomatic...
Jun 12 10:06:06 spacewalk.local.domain taskomatic[3945]: Starting RHN Taskomatic...
Jun 12 10:06:06 spacewalk.local.domain wrapper[3958]: --> Wrapper Started as Daemon
Jun 12 10:06:06 spacewalk.local.domain wrapper[3958]: Launching a JVM...
Jun 12 10:06:07 spacewalk.local.domain systemd[1]: Started Taskomatic.
[root@spacewalk ~]#

That’s it, hope you enjoy the Spacewalk and infos above.

See you!

Waldirio

[1]

Updated: