From: Peter Palfrader Date: Wed, 1 Feb 2017 07:31:06 +0000 (+0100) Subject: Make gretchaninov an archive mirror X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=159f9d320359cb17eb3e10006ab1ace4f4900df6;p=mirror%2Fdsa-puppet.git Make gretchaninov an archive mirror --- diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 8d15f70a4..e7c98be11 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -216,6 +216,8 @@ roles: debian_mirror_onion: - bilbao.debian.org - mirror-isc.debian.org + historical_mirror: + - gretchaninov.debian.org debug_mirror: - klecker.debian.org - mirror-isc.debian.org diff --git a/modules/roles/manifests/historical_mirror.pp b/modules/roles/manifests/historical_mirror.pp new file mode 100644 index 000000000..25edb230a --- /dev/null +++ b/modules/roles/manifests/historical_mirror.pp @@ -0,0 +1,28 @@ +class roles::historical_mirror { + $vhost_listen = $::hostname ? { + default => '*:80', + } + $onion_v4_addr = $::hostname ? { + default => undef, + } + $archive_root = $::hostname ? { + default => '/srv/mirrors/debian-archive', + } + + apache2::site { '010-archive.debian.org': + site => 'archive.debian.org', + content => template('roles/apache-archive.debian.org.erb'), + } + + if has_role('historical_mirror_onion') { + if ! $onion_v4_addr { + fail("Do not have an onion_v4_addr set for $::hostname.") + } + + onion::service { 'archive.debian.org': + port => 80, + target_port => 80, + target_address => $onion_v4_addr, + } + } +} diff --git a/modules/roles/manifests/init.pp b/modules/roles/manifests/init.pp index 15b79f05d..8e9f2bb36 100644 --- a/modules/roles/manifests/init.pp +++ b/modules/roles/manifests/init.pp @@ -71,6 +71,9 @@ class roles { if has_role('security_mirror') { include roles::security_mirror } + if has_role('historical_mirror') { + include roles::historical_mirror + } if has_role('debian_mirror') { include roles::debian_mirror } diff --git a/modules/roles/templates/apache-archive.debian.org.erb b/modules/roles/templates/apache-archive.debian.org.erb new file mode 100644 index 000000000..611b27c5f --- /dev/null +++ b/modules/roles/templates/apache-archive.debian.org.erb @@ -0,0 +1,26 @@ +## +## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE. +## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git +## + +> + ServerAdmin debian-admin@debian.org + ServerName archive.debian.org + <% if scope.function_onion_global_service_hostname(['archive.debian.org']) -%> + ServerAlias <%= scope.function_onion_global_service_hostname(['archive.debian.org']) %> + <% end %> + + RedirectMatch "^/$" /debian-archive/ + Alias /debian-archive/ <%= archive_root %>/ + + ErrorLog /var/log/apache2/archive.debian.org-error.log + CustomLog /var/log/apache2/archive.debian.org-access.log privacy + + Use ftp-archive <%= archive_root %> + + + UserDir disabled + + + +# vim:set syn=apache: