[Spacewalk-list] Using Spacewalk repos without registration

Fabiano Martins fabiano.martins at trt4.jus.br
Thu Oct 9 17:44:31 UTC 2014


Thank you a lot: I install it and works fine to me!

I'm thinking of improve it to include parameters to define "last" or "all"
packages, and also to perform createrepo automatically on changed repos. If
I do it, I'll submit to original author.



2014-10-07 13:27 GMT-03:00 Glen Collins <glenc2004 at comcast.net>:

>
> 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
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20141009/c35e1d70/attachment.htm>


More information about the Spacewalk-list mailing list