[Spacewalk-list] script to create webserver accessible repo of packages under Spacewalk channels

Matthew Patton mpatton at inforelay.com
Tue Sep 4 20:47:18 UTC 2012


On Tue, 04 Sep 2012 12:43:22 -0400, Boyd, Robert  
<Robert.Boyd at peoplefluent.com> wrote:

> At the remote sites I'm using Spacewalk Proxy Servers.   How can/will  
> this script work with those? Should I use reposync+createrepo to build  
> mirrors on the Proxy servers?  Or is there another way?  Most of my  
> clients won't have direct access to the master due to network and  
> firewall restrictions.

I've not used a Spacewalk Proxy. Never seen the point when you can just  
use Squid or something similar. (for the record I don't use Jabber,  
Cobbler, nor monitoring either. if I assign a task to a client it will  
execute it when it next checks in. That's how it should be IMO. KISS)

The script is really only useful on the machine that has the actual  
packages. The whole point was to bypass Satellite's interference and talk  
directly to Apache. So I could do something like "yum install  
http://<spacewalk>/pub/channels/<channel_name>/getPackage/<pkgname>".

For SProxy the URL it processes is "http://<server>/ks/dist/<dist  
name>/getPackage/<rpmfile>". What I did was define a Distribution  
"CentOS-6-x86_64" and associated it with my "centos-6-base-x86_64" channel  
(whose metadata path as we recall from previous posts is  
/var/cache/rhn/repodata/<chan name>) thru the WebUI. But for it to accept  
it as valid, I needed to drop a vmlinux and initrd into ./images/pxeboot/.  
Just create the subdirs and drop the files into the same hierarchy. Now  
you have a valid Distribution and the 'getPackage' (actually it gets  
re-assigned to DownloadFile.do) can figure out where to go.

Please note that this latter case the fact that I have 'getPackage/' under  
the channel directory full of symlinks is of no importance. 'getPackage'  
in this instance is an API call and is completely ignoring the filesystem.  
It's only utility was for direct YUM access.

So, to answer your question If you want to "cache" packages on the Proxy  
hosts, you could reposync against the master with YUM by using my backdoor  
method. As to clients directly using YUM against the Proxy, I don't know.  
If there's an actual webserver running then of course you can. If the  
Proxy is just a simple URL/API relay, I don't see how it will work.  
Nothing stopping you from installing lighttpd or something similar on the  
host though.

I'm going to decompile DownloadFile.class to figure out what path  
assumptions it uses because I'd like to see what else I can grab with  
"http://<space>/download/<some path>" aka  
'/rhn/common/DownloadFile.do?url=<some path>".

-- 
Cloud Services Architect, Senior System Administrator
InfoRelay Online Systems (www.inforelay.com)




More information about the Spacewalk-list mailing list