]> gitweb.fluxo.info Git - puppet-apt.git/commitdiff
Add $main_apt_source
authorGabriel Filion <lelutin@gmail.com>
Mon, 25 Oct 2010 15:55:15 +0000 (11:55 -0400)
committerGabriel Filion <lelutin@gmail.com>
Mon, 25 Oct 2010 18:12:18 +0000 (14:12 -0400)
Currently, it's either we use the default source that's hardcoded in the
sources.list template or we redefine entirely this template.

Make it easier to just change the URL of the apt source while using the
rest of the default template by adding a $main_apt_source variable.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
manifests/init.pp
templates/Debian/sources.list.erb
templates/Ubuntu/sources.list.erb

index ea187f34057e540d43a9d7e2650736d24ba46225..8588932165faf6c2afc0c3667a9bfeb99408d182 100644 (file)
@@ -10,6 +10,14 @@ class apt {
     require => undef,
   }
 
+  $real_main_apt_source = $main_apt_source ? {
+    '' => $operatingsystem ? {
+      "Ubuntu" => "http://de.archive.ubuntu.com/ubuntu/",
+      default => "http://ftp.debian.org/debian/",
+    },
+    default => $main_apt_source,
+  }
+
   include lsb
   config_file {
     # include main, security and backports
index ab029cac427f453bbd2b1c9a80d93f469fcf6fae..12d10270e2d7f61fc83b7e104924278856d8c494 100644 (file)
@@ -2,7 +2,7 @@
 # all local modifications will be overwritten
 
 # basic <%= lsbdistcodename %>
-deb http://ftp.debian.org/debian/ <%= lsbdistcodename %> main contrib non-free
+deb <%= real_main_apt_source %> <%= lsbdistcodename %> main contrib non-free
 # security suppport
 <% if (lsbdistcodename == "sid" || lsbdistcodename == "unstable") -%>
 # There is no security mirror for <%= lsbdistcodename %>
index a37fffc16d2795168ac49268e13be890031c0ff0..2719934ae2535f5c914ab947f6812ac5c1122ede 100644 (file)
@@ -2,7 +2,7 @@
 # all local modifications will be overwritten
 
 # basic <%= lsbdistcodename %>
-deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %> main restricted universe multiverse
+deb <%= real_main_apt_source %> <%= lsbdistcodename %> main restricted universe multiverse
 
 # updates
 deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-updates main restricted universe multiverse