From 747839287a544fb8413d96108ed11f313628f89d Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 24 Feb 2017 09:37:43 +0100 Subject: [PATCH] Add archive rsync to historical_mirror role --- .../rsyncd.conf | 0 modules/roles/manifests/historical_master.pp | 14 ------- modules/roles/manifests/historical_mirror.pp | 41 +++++++++++++++++-- modules/roles/manifests/init.pp | 3 -- 4 files changed, 38 insertions(+), 20 deletions(-) rename modules/roles/files/{historical_master => historical_mirror}/rsyncd.conf (100%) delete mode 100644 modules/roles/manifests/historical_master.pp diff --git a/modules/roles/files/historical_master/rsyncd.conf b/modules/roles/files/historical_mirror/rsyncd.conf similarity index 100% rename from modules/roles/files/historical_master/rsyncd.conf rename to modules/roles/files/historical_mirror/rsyncd.conf diff --git a/modules/roles/manifests/historical_master.pp b/modules/roles/manifests/historical_master.pp deleted file mode 100644 index c0953f17a..000000000 --- a/modules/roles/manifests/historical_master.pp +++ /dev/null @@ -1,14 +0,0 @@ -class roles::historical_master { - $sslname = 'archive-master.debian.org' - - rsync::site_systemd { 'archive_master': - source => 'puppet:///modules/roles/historical_master/rsyncd.conf', - max_clients => 100, - sslname => $sslname, - } - - ssl::service { $sslname: - key => true, - tlsaport => [], - } -} diff --git a/modules/roles/manifests/historical_mirror.pp b/modules/roles/manifests/historical_mirror.pp index 853848198..6bd1be2e3 100644 --- a/modules/roles/manifests/historical_mirror.pp +++ b/modules/roles/manifests/historical_mirror.pp @@ -2,10 +2,27 @@ class roles::historical_mirror { include roles::archvsync_base include apache2::expires - $vhost_listen = $::hostname ? { - klecker => '130.89.148.13:80 2001:610:1908:b000::148:13:80', - default => '*:80', + $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" } + ], ' ') + } + $onion_v4_addr = $::hostname ? { default => undef, } @@ -18,6 +35,24 @@ class roles::historical_mirror { content => template('roles/apache-archive.debian.org.erb'), } + if has_role('historical_master') { + $sslname = 'archive-master.debian.org' + ssl::service { $sslname: + key => true, + tlsaport => [], + } + } else { + $sslname = '' + } + + rsync::site_systemd { 'archive': + source => 'puppet:///modules/roles/historical_mirror/rsyncd.conf', + max_clients => 100, + sslname => $sslname, + bind => $rsync_bind, + bind6 => $rsync_bind6, + } + if has_role('historical_mirror_onion') { if ! $onion_v4_addr { fail("Do not have an onion_v4_addr set for $::hostname.") diff --git a/modules/roles/manifests/init.pp b/modules/roles/manifests/init.pp index a852abd5b..592397cf1 100644 --- a/modules/roles/manifests/init.pp +++ b/modules/roles/manifests/init.pp @@ -57,9 +57,6 @@ class roles { } # archive.debian.org - if has_role('historical_master') { - include historical_master - } if has_role('historical_mirror') { include roles::historical_mirror } -- 2.20.1