Added wheel hosting for AFS mirror slave

This patch adds a vhost that exposes /afs/openstack.org/mirror/wheel
to the internet under <hostname>/wheel. It also adds appropriate
rewrite rules.

Change-Id: Id514a76f7759b663b2ea3a3ec4aa2dfe083d6666
This commit is contained in:
Michael Krotscheck 2016-01-21 10:57:12 -08:00
parent 320dd74280
commit b107426201
2 changed files with 21 additions and 0 deletions

View File

@ -6,6 +6,8 @@ class openstack_project::mirror (
$mirror_root = '/afs/.openstack.org/mirror' $mirror_root = '/afs/.openstack.org/mirror'
$pypi_root = "${mirror_root}/pypi" $pypi_root = "${mirror_root}/pypi"
$wheel_root = "${mirror_root}/wheel"
$www_base = '/var/www' $www_base = '/var/www'
$www_root = "${www_base}/mirror" $www_root = "${www_base}/mirror"
@ -37,6 +39,17 @@ class openstack_project::mirror (
] ]
} }
# Create the symlink to wheel.
file { "${www_root}/wheel":
ensure => link,
target => "${wheel_root}",
owner => root,
group => root,
require => [
File["${www_root}"],
]
}
file { "${www_root}/robots.txt": file { "${www_root}/robots.txt":
ensure => present, ensure => present,
owner => 'root', owner => 'root',

View File

@ -34,6 +34,14 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
RewriteCond %{DOCUMENT_ROOT}/pypi/simple/$1/$1$2 -d RewriteCond %{DOCUMENT_ROOT}/pypi/simple/$1/$1$2 -d
RewriteRule ^/pypi/simple/([^/])([^/]*)(/.*)?$ /pypi/simple/$1/$1$2$3 [L] RewriteRule ^/pypi/simple/([^/])([^/]*)(/.*)?$ /pypi/simple/$1/$1$2$3 [L]
# Wheel URL's are:
# /wheel/{distro}-{distro-version}/a/a/a-etc.whl
# /wheel/{distro}-{distro-version}/a/abcd/abcd-etc.whl
# /wheel/{distro}-{distro-version}/a/abcde/abcde-etc.whl
RewriteCond %{REQUEST_URI} ^/wheel/([^/]+)/([^/])([^/]*)
RewriteCond %{DOCUMENT_ROOT}/wheel/$1/$2/$2$3 -d
RewriteRule ^/wheel/([^/]+)/([^/])([^/]*)(/.*)?$ /wheel/$1/$2/$2$3$4 [L]
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
LogLevel warn LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined