Use caching reverse proxy for rdo repos

We can't sanely mirror the rdo packages beacuse they are constantly
updating. Instead put a caching reverse proxy in front of the repos in
each region on our existing mirror servers. This should allow us to get
region local data that is "hot" and hopefully improve reliability to the
rdo repos.

Change-Id: I6ab810f7b6788459da1cee00baf6b053f31843cf
This commit is contained in:
Clark Boylan 2017-03-29 13:42:29 -07:00
parent 1b0e016093
commit f27298869c
2 changed files with 45 additions and 0 deletions

View File

@ -202,6 +202,14 @@ class openstack_project::mirror (
# Build VHost
include ::httpd
file { '/opt/apache_cache':
ensure => directory,
owner => 'www-data',
group => 'www-data',
mode => '0755',
require => Class['httpd']
}
if ! defined(Httpd::Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present,
@ -214,6 +222,24 @@ class openstack_project::mirror (
}
}
if ! defined(Httpd::Mod['cache']) {
httpd::mod { 'cache':
ensure => present,
}
}
if ! defined(Httpd::Mod['cache_disk']) {
httpd::mod { 'cache_disk':
ensure => present,
}
}
if ! defined(Httpd::Mod['proxy']) {
httpd::mod { 'proxy':
ensure => present,
}
}
::httpd::vhost { $vhost_name:
port => 80,
priority => '50',

View File

@ -81,4 +81,23 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
ServerSignature Off
# Caching reverse proxy for things that don't make sense in AFS
#
# General cache rules
CacheRoot "/opt/apache_cache"
CacheDirLevels 5
CacheDirLength 3
# Prevent thundering herds.
CacheLock on
CacheLockPath "/tmp/mod_cache-lock"
CacheLockMaxAge 5
# 100MB
CacheMaxFileSize 104857600
# Per site caching reverse proxy rules
# Only cache specific backends, rely on afs cache otherwise.
CacheEnable disk "/rdo"
ProxyPass "/rdo" "https://trunk.rdoproject.org/"
ProxyPassReverse "/rdo" "https://trunk.rdoproject.org/"
</VirtualHost>