[CentOS-mirror] Looking for a machine readable full mirror list.

Fri Mar 24 19:32:06 UTC 2017
Eliezer Croitoru <eliezer at ngtech.co.il>

I am writing a script for someone running foreman and he is using squid as a
proxy.
Now the issue is that he is using the mirror api:
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates

and he the receives a tiny list of mirrors.
So I wrote this script:
https://gist.github.com/elico/dc1af72344231d6d49af4eacecfae8df#file-get-full
-mirrolist-rb

To fetch the urls of all the active mirrors from the page:
http://mirror-status.centos.org/

And it works pretty nice.
The idea is that it will be updated once every while in an incremented way.

The csv looks promising but I added my 1 Cent to bucket with the first
script.

Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: eliezer at ngtech.co.il


-----Original Message-----
From: CentOS-mirror [mailto:centos-mirror-bounces at centos.org] On Behalf Of
Anssi Johansson
Sent: Friday, March 24, 2017 5:18 PM
To: centos-mirror at centos.org
Subject: Re: [CentOS-mirror] Looking for a machine readable full mirror
list.

24.3.2017, 16.09, Eliezer  Croitoru kirjoitti:
> Hey List,
>
> I am writing a script for a local proxy and I want to add the full 
> list of mirrors into the proxy allowed acls.
> Is there a machine readable list of all hosts and url's of all public 
> mirrors?
> The other option I had in mind is parsing the table at:
> http://mirror-status.centos.org

If you have a look at how https://www.centos.org/download/mirrors/ is
generated, you will notice that it will fetch the data from
https://www.centos.org/download/full-mirrorlist.csv

But I'm not sure if that's a good approach, because that list may change
every now and then. If I were you, I would set up a local mirror using rsync
from some external mirror, and point the local machines using CentOS to that
mirror. That would save bandwidth, and save you from maintaining that ACL
(even if it's automated).

_______________________________________________
CentOS-mirror mailing list
CentOS-mirror at centos.org
https://lists.centos.org/mailman/listinfo/centos-mirror