From: Peter Palfrader Date: Fri, 24 Feb 2017 08:37:43 +0000 (+0100) Subject: Add archive rsync to historical_mirror role X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=747839287a544fb8413d96108ed11f313628f89d;p=mirror%2Fdsa-puppet.git Add archive rsync to historical_mirror role --- diff --git a/modules/roles/files/historical_master/rsyncd.conf b/modules/roles/files/historical_master/rsyncd.conf deleted file mode 100644 index 976bb13c3..000000000 --- a/modules/roles/files/historical_master/rsyncd.conf +++ /dev/null @@ -1,18 +0,0 @@ -uid = nobody -gid = nogroup -max connections = 25 -syslog facility = daemon -socket options = SO_KEEPALIVE -timeout = 7200 -log file = /var/log/rsyncd/rsyncd-archive.log - -[debian-archive] - path = /srv/mirrors/debian-archive - comment = Debian Historical Archives (use -H to save space) - read only = true - -[archive] - path = /srv/mirrors/debian-archive - comment = Debian Archive (use -H to save space) - read only = true - list = no diff --git a/modules/roles/files/historical_mirror/rsyncd.conf b/modules/roles/files/historical_mirror/rsyncd.conf new file mode 100644 index 000000000..976bb13c3 --- /dev/null +++ b/modules/roles/files/historical_mirror/rsyncd.conf @@ -0,0 +1,18 @@ +uid = nobody +gid = nogroup +max connections = 25 +syslog facility = daemon +socket options = SO_KEEPALIVE +timeout = 7200 +log file = /var/log/rsyncd/rsyncd-archive.log + +[debian-archive] + path = /srv/mirrors/debian-archive + comment = Debian Historical Archives (use -H to save space) + read only = true + +[archive] + path = /srv/mirrors/debian-archive + comment = Debian Archive (use -H to save space) + read only = true + list = no 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 }