From: Peter Palfrader Date: Fri, 8 Jan 2016 21:12:57 +0000 (+0000) Subject: Make an apache site for syncproxies X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=8f515ddb04dacc7c5ccb304639aefe6b6c7f921e;p=mirror%2Fdsa-puppet.git Make an apache site for syncproxies --- diff --git a/modules/roles/manifests/syncproxy.pp b/modules/roles/manifests/syncproxy.pp index bf19bd016..7e3423a90 100644 --- a/modules/roles/manifests/syncproxy.pp +++ b/modules/roles/manifests/syncproxy.pp @@ -13,6 +13,13 @@ class roles::syncproxy { 'klecker' => '2001:610:1908:b000::148:10', default => '' } + $syncproxy_name = $::hostname ? { + 'milanollo' => 'syncproxy3.eu.debian.org', + 'mirror-isc' => 'syncproxy2.wna.debian.org', + 'mirror-umn' => 'syncproxy.cna.debian.org', + 'klecker' => 'syncproxy2.eu.debian.org', + default => 'unknown' + } rsync::site { 'syncproxy': content => template('roles/syncproxy/rsyncd.conf.erb'), @@ -29,4 +36,19 @@ class roles::syncproxy { group => 'mirroradm', mode => 0660, } + + if $::apache2 and $syncproxy_name != 'unknown' { + apache2::site { '010-syncproxy.debian.org': + site => 'security.debian.org', + content => template('roles/syncproxy/syncproxy.debian.org-apache.erb') + } + + file { [ '/srv/www/syncproxy.debian.org', '/srv/www/syncproxy.debian.org/htdocs' ]: + ensure => directory, + mode => '0755', + } + file { '/srv/www/syncproxy.debian.org/htdocs/index.html': + content => template('roles/syncproxy/syncproxy.debian.org-index.html.erb') + } + } } diff --git a/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb b/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb new file mode 100644 index 000000000..db525133f --- /dev/null +++ b/modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb @@ -0,0 +1,40 @@ +## +## 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 +## + +<% + vhost_listen = [ (bind != '') ? "#{bind}:80" : "*:80", (bind6 != '') ? "#{bind6}:80" : "*:80"].uniq.join(' ') +%> + + > + ServerName <%= syncproxy_name %> + DocumentRoot /srv/www/syncproxy.debian.org/htdocs + + + Require all granted + + + CustomLog /var/log/apache2/syncproxy.debian.org-access.log privacy + ErrorLog /var/log/apache2/syncproxy.debian.org-error.log + +<%= +lines = [] +%w{debian debian-backports debian-debug debian-security}.each do |archive| + varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_') + if has_variable?(varname) and (eval(varname)) == 'true' + lines << " Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/" + lines << " " + lines << " Require all granted" + lines << " IndexOptions NameWidth=* +SuppressDescription" + lines << " Options +Indexes" + lines << " " + end +end + +lines.join("\n") +%> + + + +# vim: set ts=3 sw=3 et: diff --git a/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb b/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb new file mode 100644 index 000000000..a3e0070c2 --- /dev/null +++ b/modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb @@ -0,0 +1,41 @@ + + + + Welcome to <%= syncproxy_name %>! + + + +

Welcome to <%= syncproxy_name %>!

+ +This is <%= syncproxy_name %>, a syncproxy run by and for the Debian Project to aid in mirroring +our software. Consult the +mirrors section of the Debian website for more information. + +

+This syncproxy contains copies of the following archives. + +

+ + +

+Please contact the Debian mirrors team for rsync access if your +mirror should become a push primary mirror (see the documenation). + +

+


+Debian mirrors team + + +