Merge "Added pypi hosting for AFS mirror slave"

This commit is contained in:
Jenkins
2016-01-22 21:52:06 +00:00
committed by Gerrit Code Review
2 changed files with 86 additions and 0 deletions

View File

@@ -5,5 +5,54 @@ class openstack_project::mirror (
) {
$mirror_root = '/afs/openstack.org/mirror'
$pypi_root = "${mirror_root}/pypi"
$www_root = '/var/www/mirror'
#####################################################
# Build Apache Webroot
file { "${www_root}":
ensure => directory,
owner => root,
group => root,
}
# Create the symlink to pypi.
file { "${www_root}/pypi":
ensure => link,
target => "${pypi_root}/web",
owner => root,
group => root,
require => [
File["${www_root}"],
]
}
file { "${www_root}/robots.txt":
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/disallow_robots.txt',
require => File["${www_root}"],
}
#####################################################
# Build VHost
include ::httpd
if ! defined(Httpd::Mod['rewrite']) {
httpd::mod { 'rewrite':
ensure => present,
}
}
::httpd::vhost { $vhost_name:
port => 80,
priority => '50',
docroot => "${www_root}",
template => 'openstack_project/mirror.vhost.erb',
require => [
File["${www_root}"],
]
}
}