summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-10-17 10:51:06 +0200
committerintrigeri <intrigeri@boum.org>2010-10-17 10:51:06 +0200
commite42b54af40ca47ada74a4bb1e410046975b89c32 (patch)
tree795bb4cac7665eb11642e2065b0f3bf2d988a8ce
parent2d75cda2dbefb730777ab03c592f8cd58e30d617 (diff)
Support choosing a custom Ubuntu mirror.
-rw-r--r--README6
-rw-r--r--manifests/init.pp4
-rw-r--r--templates/Ubuntu/sources.list.erb16
3 files changed, 18 insertions, 8 deletions
diff --git a/README b/README
index b786b9d..8c32ca4 100644
--- a/README
+++ b/README
@@ -112,6 +112,12 @@ 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.
+$apt_ubuntu_url
+---------------
+
+These variables allows to override the default APT mirror used for all
+standard Ubuntu archives (including updates, security, backports).
+
$apt_repos
----------
diff --git a/manifests/init.pp b/manifests/init.pp
index 82eb231..f3c8845 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -44,6 +44,10 @@ class apt {
'' => 'http://volatile.debian.org/debian-volatile/',
default => "${apt_volatile_url}",
}
+ $ubuntu_url = $apt_ubuntu_url ? {
+ '' => 'http://archive.ubuntu.com/ubuntu',
+ default => "${apt_ubuntu_url}",
+ }
case $operatingsystem {
'debian': {
$repos = $apt_repos ? {
diff --git a/templates/Ubuntu/sources.list.erb b/templates/Ubuntu/sources.list.erb
index 328d9e2..1486e95 100644
--- a/templates/Ubuntu/sources.list.erb
+++ b/templates/Ubuntu/sources.list.erb
@@ -1,25 +1,25 @@
# This file is brought to you by puppet
# basic <%= lsbdistcodename %>
-deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %> <%= repos %>
+deb <%= ubuntu_url %> <%= lsbdistcodename %> <%= repos %>
<% if include_src then -%>
-deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %> <%= repos %>
+deb-src <%= ubuntu_url %> <%= lsbdistcodename %> <%= repos %>
<% end -%>
# updates
-deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-updates <%= repos %>
+deb <%= ubuntu_url %> <%= lsbdistcodename %>-updates <%= repos %>
<% if include_src then -%>
-deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-updates <%= repos %>
+deb-src <%= ubuntu_url %> <%= lsbdistcodename %>-updates <%= repos %>
<% end -%>
# security suppport
-deb http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security <%= repos %>
+deb <%= ubuntu_url %> <%= lsbdistcodename %>-security <%= repos %>
<% if include_src then -%>
-deb-src http://de.archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-security <%= repos %>
+deb-src <%= ubuntu_url %> <%= lsbdistcodename %>-security <%= repos %>
<% end -%>
# backports
-deb http://archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-backports main <%= repos %>
+deb <%= ubuntu_url %> <%= lsbdistcodename %>-backports main <%= repos %>
<% if include_src then -%>
-deb-src http://archive.ubuntu.com/ubuntu <%= lsbdistcodename %>-backports <%= repos >
+deb-src <%= ubuntu_url %> <%= lsbdistcodename %>-backports <%= repos >
<% end -%>