[Spacewalk-list] Using Spacewalk repos without registration

Glen Collins glenc2004 at comcast.net
Tue Oct 7 16:27:15 UTC 2014


Oh, one thing I need to mention. I did have to make one change to the code in the script so it would link all rpm's. The code from GIT actually only links the latest in the channel and not everything. So the change I made was....

Change "spacewalk.channel.software.listLatestPackages" to "spacewalk.channel.software.listAllPackages". See below....

-----------------------------------------

    ## for pkg in spacewalk.channel.software.listLatestPackages(spacekey, options.channel):
    for pkg in spacewalk.channel.software.listAllPackages(spacekey, options.channel):
        det=spacewalk.packages.getDetails(spacekey, pkg['id'])
        fn=det['path'].split("/")[-1]
        if not os.path.exists("%s/packages/%s" % (options.directory, fn)):
            os.symlink("%s/%s" % (options.satdir, det['path']), "%s/packages/%s" % (options.directory, fn))
    spacewalk.auth.logout(spacekey)

-----------------------------------------

Regards,

Glen Collins

----- Original Message -----

Hi Fabiano,

  Are you asking if you can create a pseudo repo in Spacewalk that can mimic a YUM repository via HTTP? If that is what you are asking, then yes it is possible. And I have done it so I can install my spacewalk clients using the yum method. Here is what you do...

1) Download and install: https://github.com/angrox/spacewalk-api-scripts

2) Create directory under: /var/www/html/pub/<software name> (this is accessible using the URL http://<SW IP ADDR>/pub/<software name>)

3) Call the script: spacewalk-create-yumrepo.py (Which I installed in /usr/local/bin)

   /usr/local/bin/spacewalk-create-yumrepo.py -s <SW IP ADDR> -u admin -p xxxx -c <SW channel name> -d /var/www/html/pub/<dir>/<software>

4) Run createrepo against the new directory: createrepo /var/www/html/pub/<dir>/<software>

5) And then configure you client using the stand YUM file in /etc/yum.repos.d

6) Verify you can see it using your web browser. You may run into permissions issue accessing the repomd.xml in the repodata directory. What I do is a chmod -R 755 on the entire /var/www/html/pub/<dir>/<software> so I don't have any issues with he web server accessing the files.

What this is doing is creating links to the actual RPM's in /var/satellite/..... so when you access it via HTTP it looks exactly like a standard YUM repo. So you don't have to have any extra copies of any of the RPM's taking up extra space. Now while I only have done this for the SW client install, I can assume since it works for the client and it should work for everything include the OS, EPEL and all the other channels you may have in SW.

Regards,

Glen Collins

----- Original Message -----
Fabiano Martins wrote:
% Hi all,
% 
% I have a Spacewalk 2.2 server running on my environment.
% 
% But some machines aren't registered on Spacewalk (RHELs registered on RHN,
% CentOSs that sysadmin don't like to register on Spacewalk, etc.).
% 
% Once my Spacewalk server already have a mirror of external repos (EPEL,
% VMWare, etc.), I would that these exceptions not use my Internet link when
% installing/updating packages.
% 
% Have a form to offer these repos mirrored into Spacewalk as a "pure http"
% repo?

Hello Fabiano,

Unfortunately Spacewalk can't do this.

% I know that I can mirror external repos via rsync and "re-mirror" to
% Spacewalk via spacewalk-repo-sycnc, but on this case I would use 2 times
% each file on disk...
% 
% Thanks,
% 
% Fabiano Martins

Regards,

--
Michael Mráka
Satellite Engineering, Red Hat

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

_______________________________________________
Spacewalk-list mailing list
Spacewalk-list at redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list