From dbc05fea3a598046994dbc58fc66402a25b1aaba Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sun, 26 Aug 2012 07:23:32 +0000 Subject: [PATCH] Allow setting main debian mirror via puppet --- modules/debian-org/manifests/init.pp | 24 ++++++++++++++++++++---- modules/debian-org/misc/hoster.yaml | 3 +++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/modules/debian-org/manifests/init.pp b/modules/debian-org/manifests/init.pp index a12ce2d91..04db264f5 100644 --- a/modules/debian-org/manifests/init.pp +++ b/modules/debian-org/manifests/init.pp @@ -98,10 +98,18 @@ class debian-org { components => ['main','contrib','non-free'] } - site::aptrepo { 'volatile': - url => 'http://ftp.debian.org/debian', - suite => "${::lsbdistcodename}-updates", - components => ['main','contrib','non-free'] + if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') { + site::aptrepo { 'volatile': + url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), + suite => "${::lsbdistcodename}-updates", + components => ['main','contrib','non-free'] + } + } else { + site::aptrepo { 'volatile': + url => 'http://ftp.debian.org/debian', + suite => "${::lsbdistcodename}-updates", + components => ['main','contrib','non-free'] + } } } site::aptrepo { 'backports.org': @@ -121,6 +129,14 @@ class debian-org { key => 'puppet:///modules/debian-org/db.debian.org.asc', } + if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') { + site::aptrepo { 'debian': + url => getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), + suite => "${::lsbdistcodename}", + components => ['main','contrib','non-free'] + } + } + file { '/etc/facter': ensure => directory, purge => true, diff --git a/modules/debian-org/misc/hoster.yaml b/modules/debian-org/misc/hoster.yaml index 49752c070..cdb3da857 100644 --- a/modules/debian-org/misc/hoster.yaml +++ b/modules/debian-org/misc/hoster.yaml @@ -59,6 +59,7 @@ conova: netrange: - 217.196.149.224/28 nameservers: [217.196.144.129, 217.196.144.229] + mirror-debian: http://debian.inode.at/debian/ csail: netrange: - 128.31.0.0/24 @@ -111,6 +112,7 @@ uni-karlsruhe: - 2001:41b8:202:deb::/64 searchpaths: [debprivate-darmstadt.debian.org] nameservers: [82.195.66.249, 217.198.242.225] + mirror-debian: http://debian.netcologne.de/debian/ marist: netrange: - 148.100.96.0/25 @@ -150,6 +152,7 @@ sil: #nameservers: [213.129.232.1, 213.129.226.2] nameservers: [86.59.118.147, 86.59.118.148] allow_dns_query: [86.59.118.144/28, 2001:858:2:2::/64] + mirror-debian: http://ftp.at.debian.org/debian/ ubcece: netrange: - 137.82.84.64/27 -- 2.20.1