From e8dc3158ada8326337eab361ae00d96a5d07cc3b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 24 Feb 2017 09:05:00 +0000 Subject: [PATCH] fix archive mirror bind magic --- modules/roles/manifests/historical_mirror.pp | 28 +++++-------------- .../templates/apache-archive.debian.org.erb | 9 ++++++ 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/modules/roles/manifests/historical_mirror.pp b/modules/roles/manifests/historical_mirror.pp index 6bd1be2e3..d80b1afb4 100644 --- a/modules/roles/manifests/historical_mirror.pp +++ b/modules/roles/manifests/historical_mirror.pp @@ -2,25 +2,12 @@ class roles::historical_mirror { include roles::archvsync_base include apache2::expires - $rsync_bind = $::hostname ? { - gretchaninov => '209.87.16.41', - klecker => '130.89.148.13', - mirror-conova => '217.196.149.234', - sibelius => '193.62.202.28', - default => '', - } - $rsync_bind6 = $::hostname ? { - gretchaninov => '2607:f8f0:614:1::1274:41', - klecker => '2001:610:1908:b000::148:13', - mirror-conova => '2a02:16a8:dc41:100::234', - sibelius => '2001:630:206:4000:1a1a:0:c13e:ca1c', - default => '', - } - - $vhost_listen = join([ - ($rsync_bind == '') ? { true => "*:80", default => "$rsync_bind:80" }, - ($rsync6_bind == '') ? { true => "*:80", default => "[$rsync6_bind]:80" } - ], ' ') + $binds = $::hostname ? { + gretchaninov => ['209.87.16.41' , '[2607:f8f0:614:1::1274:41]' ], + klecker => ['130.89.148.13' , '[2001:610:1908:b000::148:13]' ], + mirror-conova => ['217.196.149.234', '[2a02:16a8:dc41:100::234]' ], + sibelius => ['193.62.202.28' , '[2001:630:206:4000:1a1a:0:c13e:ca1c]'], + default => ['[::]'], } $onion_v4_addr = $::hostname ? { @@ -49,8 +36,7 @@ class roles::historical_mirror { source => 'puppet:///modules/roles/historical_mirror/rsyncd.conf', max_clients => 100, sslname => $sslname, - bind => $rsync_bind, - bind6 => $rsync_bind6, + binds => $binds, } if has_role('historical_mirror_onion') { diff --git a/modules/roles/templates/apache-archive.debian.org.erb b/modules/roles/templates/apache-archive.debian.org.erb index e405bb353..6dad6dc8f 100644 --- a/modules/roles/templates/apache-archive.debian.org.erb +++ b/modules/roles/templates/apache-archive.debian.org.erb @@ -3,6 +3,15 @@ ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git ## +<% + if not binds.kind_of?(Array) + raise Puppet::Error, "binds variable is not an array" + end + + vhost_listen = binds.map{|x| x+":80" }.join(' ') +%> + + > ServerAdmin debian-admin@debian.org ServerName archive.debian.org -- 2.20.1