Friday, January 13, 2012

Spacewalker Success

Ok so the bar is low but this is forward progress.  Call it sysadmin welfare.

Now to study this guys guide a bit more http://blog.xebia.com/2011/12/19/how-to-walk-with-spacewalk/


Spacewalk Installation and Initial Config.

If you've made it to this point, may the Schwartz be with you, and hopefully this will work.

Hit it...

  • yum install spacewalk-postgresql  -y
Once that finished, hopefully without error in the 308 packages...

Now to initially config it.
  • spacewalk-setup --disconnected 
    • Answers to the prompts
      • Hostname -- hit enter
      • Database -- spaceschema
      • Username -- spaceuser
      • Password -- spacepw
      • email -- I used admin@alpha0.localdomain
      • Save the default SSL for you - Y
      • Set a CA cert password
      • Organization - localdomain
      • OU - hit enter
      • Email - hit enter
      • City - Orgrimmar  (Lok'Tar?)
      • State - Insanity
      • Country - US
      • Enable the Cobbler default attack vectors as they're bloody needed ... hit Enter
It should churn a bit more and hopefully finish without error, although my first build (to this point) squawked at Tomcat having errors, examining the /var/log/tomcat*/catalina.out didn't show any.  I'll be curious to see if that error occurs the next several rebuilds of this VM.

Now open the firewall port so that port 80 is reachable.  
  • sudo system-config-firewall-tui
    • Check 'Secure WWW (HTTPS)'
    • Check 'WWW (HTTP)'

iptables -D INPUT -j REJECT --reject-with icmp-host-prohibited
iptables -A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
service iptables save
service iptables restart


Next time I build this it'll be with an answer file!

Thursday, January 12, 2012

Spacewalk and repos

So the info that is on the spacewalk wiki can die in a digital fire, it's random and sporadic on repo requirements.

Repo requirements of Centos 6.2:


  • rpm -Uvh http://spacewalk.redhat.com/yum/1.6/RHEL/6/x86_64/spacewalk-repo-1.6-1.el6.noarch.rpm
  • rpm -ihv http://spacewalk.redhat.com/yum/1.6-client/RHEL/5/x86_64/spacewalk-client-repo-1.6-1.el5.noarch.rpm
  • rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm
And my favorite:
  • sudo touch /etc/yum.repos.d/jpackage-generic.repo
    • File contents:
    • [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
At this point tweak your yum config as chances are its metadata cache may be gimped.  Errors can include "failure: repodata/filelists.sqlite.bz2 from spacewalk-client: [Errno 256] No more mirrors to try".
  • Edit /etc/yum.conf and add the following line
    • http_caching=packages
  • sudo yum clean metadata





Spacewalk Postgres install

Postgres install using default Centos repository.  Installed from my user account with sudo privs.  To say I'm a Postgres nublet is an understatement.  This I suspect to be a hotmess and in need of redress at a later date.

  • sudo yum update -y
  • sudo yum install -y 'postgresql-server > 8.4'
  • sudo chkconfig postgresql on
  • sudo service postgresql initdb
  • sudo service postgresql start
  • sudo passwd postgres (change the bloody password!)
  • su - postgres -c 'PGPASSWORD=spacepw; createdb spaceschema ; createlang plpgsql spaceschema ; yes $PGPASSWORD | createuser -P -sDR spaceuser' 
  • sudo service postgresql restart
Update /var/lib/pgsql/data/pg_hba.conf
  • Add this before all the other lines:
    • local spaceschema spaceuser md5 
    • host spaceschema spaceuser 127.0.0.1/8 md5 
    • host spaceschema spaceuser <anyothermgmtip>/24 md5    #this is for external mgmt
    • host spaceschema spaceuser ::1/128 md5
Update /var/lib/pgsql/data/postgresql.conf
  • Add this to the top, or down in the relevant section
    • sudo nano /var/lib/pgsql/data/postgresql.conf
      • listen_addresses='*'
Bounce the DBMS service to reflect the changes made
  • sudo service postgresql restart

Configure firewall to allow external (of host) connection to the DBMS.  I am using PGadmin v1.14 to access the DBMS from my Win7 development workstation.
  • system-config-firewall-tui
    • add custom tcp incoming port 5432
Lastly you'll want to have PostgreSQL service start on system boot.  The command listed below will create the necessary symlinks to make that happen

  • sudo chkconfig postgresql on


After all this is done, PGadmin 'should' be able to connect and the database should be running and configured to support the pending Spacewalk installation.

Spacewalk Adventures

This is a chronicle of my adventure setting up a functioning virtual machine (VM) based on Spacewalk to handle all of my system provisioning and package management needs.  The installation notes  https://fedorahosted.org/spacewalk/wiki/UserDocs#Installation while good, do not work for me.  Somewhere in the documentation configuration management (CM) it broke. It is an excellent set of documentation overall.  Murphy happens, let's move on.

Software highlights:
Spacewalk 1.6 http://spacewalk.redhat.com/

The basic idea is to create this provisioning, package management, and life-cycle deployment 'server' to make my life easier.  Where possible I want everything Open Source.  

I will proceed to post notes on, generally speaking, what 'worked'.  Not what didn't other than as anecdotal information.