Add mirror01.iad.rax.o.o

This is a new Xenial-based mirror in the RAX IAD region

Add munging to have a serveralias for numerically named servers

Change-Id: I5690e231a53a45e33bd925cd1a4a87ffa025af04
This commit is contained in:
Ian Wienand 2017-08-16 10:11:19 +10:00
parent 1f8f1fe03d
commit 50afc033aa
4 changed files with 32 additions and 3 deletions

View File

@ -443,6 +443,7 @@ cacti_hosts:
- mirror.dfw.rax.openstack.org
- mirror.gra1.ovh.openstack.org
- mirror.iad.rax.openstack.org
- mirror01.iad.rax.openstack.org
- mirror.kna1.citycloud.openstack.org
- mirror.la1.citycloud.openstack.org
- mirror.lon1.citycloud.openstack.org

View File

@ -611,7 +611,8 @@ node 'mirror-update.openstack.org' {
# Machines in each region to serve AFS mirrors.
# Node-OS: trusty
node /^mirror\..*\.openstack\.org$/ {
# Node-OS: xenial
node /^mirror\d*\..*\.openstack\.org$/ {
$group = "mirror"
class { 'openstack_project::server':

View File

@ -4,6 +4,16 @@ class openstack_project::mirror (
$vhost_name = $::fqdn,
) {
# Some hosts are mirror01, but we need the host to respond to
# "mirror." Re-evaluate this if we end up doing multiple
# mirrors/load balancing etc.
$alias_name = regsubst($vhost_name, 'mirror\d*\.', 'mirror.')
if $alias_name != $vhost_name {
$serveraliases = [$alias_name]
} else {
$serveraliases = undef
}
$mirror_root = '/afs/openstack.org/mirror'
$pypi_root = "${mirror_root}/pypi"
$wheel_root = "${mirror_root}/wheel"
@ -283,6 +293,7 @@ class openstack_project::mirror (
priority => '50',
docroot => "${www_root}",
template => 'openstack_project/mirror.vhost.erb',
serveraliases => $serveraliases,
require => [
File["${www_root}"],
]

View File

@ -14,10 +14,12 @@ NameVirtualHost <%= @vhost_name %>:8081
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% @serveraliases.each do |name| -%>
<%= " ServerAlias #{name}\n" %>
<% end %>
<% elsif @serveraliases != nil -%>
<%= " ServerAlias #{@serveraliases}" -%>
<% end -%>
<% end %>
DocumentRoot <%= @docroot %>
<Directory <%= @docroot %>>
Options <%= @options %>
@ -93,6 +95,13 @@ NameVirtualHost <%= @vhost_name %>:8081
<VirtualHost <%= @vhost_name %>:8080>
ServerName <%= @srvname %>:8080
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%>
<%= " ServerAlias #{name}:8080\n" %>
<% end %>
<% elsif @serveraliases != nil -%>
<%= " ServerAlias #{@serveraliases}:8080" -%>
<% end %>
# Disable directory listing by default.
<Directory />
@ -183,6 +192,13 @@ NameVirtualHost <%= @vhost_name %>:8081
<VirtualHost <%= @vhost_name %>:8081>
ServerName <%= @srvname %>:8081
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%>
<%= " ServerAlias #{name}:8081\n" %>
<% end %>
<% elsif @serveraliases != nil -%>
<%= " ServerAlias #{@serveraliases}:8081" -%>
<% end %>
# Disable directory listing by default.
<Directory />