]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Allow specifying custom mirrors for every supported archive.
authorintrigeri <intrigeri@boum.org>
Wed, 6 Oct 2010 11:29:38 +0000 (13:29 +0200)
committerintrigeri <intrigeri@boum.org>
Wed, 6 Oct 2010 11:29:38 +0000 (13:29 +0200)
README
manifests/init.pp
templates/sources.list.erb

diff --git a/README b/README
index 1a0fd3c4e8ecaaf5a842badb15913ef602f3a85d..133ad226bf7fffef6dc5cf8ada8c8518878c2095 100644 (file)
--- a/README
+++ b/README
@@ -44,12 +44,11 @@ value can be set manually too, e.g. to enable forced upgrades
 
 $custom_sources_list
 --------------------
-By default this module will use a basic apt/sources.list with a
-generic debian mirror. If you need to set more specific sources,
-e.g. for country proximity, proxies, etc. you can set this variable to
-the location of your sources.list template.  For example, setting the
-following variable before including this class will pull in the
-templates/apt/sources.list file: 
+By default this module will use a basic apt/sources.list.
+If you need to set more specific sources, e.g. for proxies, etc. you
+can set this variable to the location of your sources.list template.
+For example, setting the following variable before including this
+class will pull in the templates/apt/sources.list file:
 $custom_sources_list ='template("apt/sources.list")'
                       
 $custom_preferences    
@@ -101,6 +100,13 @@ low values.
 By default this is false for backward compatibility with older
 versions of this module.
 
+$apt_debian_url, $apt_security_url, $apt_backports_url, $apt_volatile_url
+-------------------------------------------------------------------------
+
+These variables allow to override the default APT mirrors respectively
+used for the standard Debian archives, the Debian security archive,
+the Debian official backports and the Debian Volatile archive.
+
 Classes
 =======
 
@@ -156,8 +162,6 @@ TODO
 
 Enable debian-archive-keyring handling for sarge, lenny and sid.
 
-Enable selection of country-specific mirrors.
-
 Currently this module updates the caches on every run. Running dselect update is
 a expensive operation and should be done only on schedule by using apticron.
 Sometimes -- especially when initially starting management or deploying new
index 095fe79d0309109c8884dbc5f656f9935a0af5e0..63f489f848c3c83c8ce5bd19f8463ce4a1630a93 100644 (file)
@@ -26,6 +26,23 @@ class apt {
     default => $apt_use_next_release,
   }
 
+  $debian_url = $apt_debian_url ? {
+    ''      => 'http://ftp.debian.org/debian/',
+    default => "${apt_debian_url}",
+  }
+  $security_url = $apt_security_url ? {
+    ''      => 'http://security.debian.org/',
+    default => "${apt_security_url}",
+  }
+  $backports_url = $apt_backports_url ? {
+    ''      => 'http://backports.debian.org/debian-backports/',
+    default => "${apt_backports_url}",
+  }
+  $volatile_url = $apt_volatile_url ? {
+    ''      => 'http://volatile.debian.org/debian-volatile/',
+    default => "${apt_volatile_url}",
+  }
+
   package { apt:
     ensure => installed,
     require => undef,
index 687e7908a9c8ab2b1ae47bcc832f6fc7e13e193b..c5d69e779ed02bdf10ac559b1d5f70c960c6c2ab 100644 (file)
@@ -3,18 +3,18 @@
 ### Debian current: <%= codename %>
 
 # basic
-deb http://ftp.debian.org/debian/ <%= codename %> <%= repos %>
+deb <%= debian_url > <%= codename %> <%= repos %>
 <% if include_src then %>
-deb-src http://ftp.debian.org/debian/ <%= codename %> <%= repos %>
+deb-src <%= debian_url > <%= codename %> <%= repos %>
 <% end %>
 
 # security
 <% if (release == "unstable" || release == "experimental") %>
 # There is no security support for <%= release %>
 <% else %>
-deb http://security.debian.org/ <%= codename %>/updates <%= repos %>
+deb <%= security_url > <%= codename %>/updates <%= repos %>
 <% if include_src then %>
-deb-src http://security.debian.org/ <%= codename %>/updates <%= repos %>
+deb-src <%= security_url > <%= codename %>/updates <%= repos %>
 <% end %>
 <% end %>
 
@@ -22,9 +22,9 @@ deb-src http://security.debian.org/ <%= codename %>/updates <%= repos %>
 <% if (release == "testing" || release == "unstable" || release == "experimental") %>
 # There is no backports archive for <%= release %>
 <% else %>
-deb http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+deb <%= backports_url > <%= codename %>-backports <%= repos %>
 <% if include_src then %>
-deb-src http://backports.debian.org/debian-backports/ <%= codename %>-backports <%= repos %>
+deb-src <%= backports_url > <%= codename %>-backports <%= repos %>
 <% end %>
 <% end %>
 
@@ -33,9 +33,9 @@ deb-src http://backports.debian.org/debian-backports/ <%= codename %>-backports
 <% if (release == "testing" || release == "unstable" || release == "experimental") %>
 # There is no volatile archive for <%= release %>
 <% else %>
-deb http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+deb <%= volatile_url > <%= codename %>/volatile <%= repos %>
 <% if include_src then %>
-deb-src http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%= repos %>
+deb-src <%= volatile_url > <%= codename %>/volatile <%= repos %>
 <% end %>
 <% end %>
 <% end %>
@@ -44,18 +44,18 @@ deb-src http://volatile.debian.org/debian-volatile/ <%= codename %>/volatile <%=
 ### Debian next: <%= next_codename %>
 
 # basic
-deb http://ftp.debian.org/debian/ <%= next_codename %> <%= repos %>
+deb <%= debian_url > <%= next_codename %> <%= repos %>
 <% if include_src then %>
-deb-src http://ftp.debian.org/debian/ <%= next_codename %> <%= repos %>
+deb-src <%= debian_url > <%= next_codename %> <%= repos %>
 <% end %>
 
 # security
 <% if (next_release == "unstable" || next_release == "experimental") %>
 # There is no security support for <%= next_release %>
 <% else %>
-deb http://security.debian.org/ <%= next_codename %>/updates <%= repos %>
+deb <%= security_url > <%= next_codename %>/updates <%= repos %>
 <% if include_src then %>
-deb-src http://security.debian.org/ <%= next_codename %>/updates <%= repos %>
+deb-src <%= security_url > <%= next_codename %>/updates <%= repos %>
 <% end %>
 <% end %>
 
@@ -63,9 +63,9 @@ deb-src http://security.debian.org/ <%= next_codename %>/updates <%= repos %>
 <% if (next_release == "testing" || next_release == "unstable" || next_release == "experimental") %>
 # There is no backports archive for <%= next_release %>
 <% else %>
-deb http://backports.debian.org/debian-backports/ <%= next_codename %>-backports <%= repos %>
+deb <%= backports_url > <%= next_codename %>-backports <%= repos %>
 <% if include_src then %>
-deb-src http://backports.debian.org/debian-backports/ <%= next_codename %>-backports <%= repos %>
+deb-src <%= backports_url > <%= next_codename %>-backports <%= repos %>
 <% end %>
 <% end %>
 
@@ -74,9 +74,9 @@ deb-src http://backports.debian.org/debian-backports/ <%= next_codename %>-backp
 <% if (next_release == "testing" || next_release == "unstable" || next_release == "experimental") %>
 # There is no volatile archive for <%= next_release %>
 <% else %>
-deb http://volatile.debian.org/debian-volatile/ <%= next_codename %>/volatile <%= repos %>
+deb <%= volatile_url > <%= next_codename %>/volatile <%= repos %>
 <% if include_src then %>
-deb-src http://volatile.debian.org/debian-volatile/ <%= next_codename %>/volatile <%= repos %>
+deb-src <%= volatile_url > <%= next_codename %>/volatile <%= repos %>
 <% end %>
 <% end %>
 <% end %>