9f201a64e8
Change-Id: Ifa05c9848ca6a1d8991be4d02ecdea8d719ee4ed Reviewed-on: https://review.openstack.org/24855 Reviewed-by: Anita Kuno <akuno@lavabit.com> Approved: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Khai Do <zaro0508@gmail.com> Tested-by: Jenkins
150 lines
3.9 KiB
Puppet
150 lines
3.9 KiB
Puppet
# == Class: openstack_project::static
|
|
#
|
|
class openstack_project::static (
|
|
$sysadmins = [],
|
|
$reviewday_gerrit_ssh_key = '',
|
|
$reviewday_rsa_pubkey_contents = '',
|
|
$reviewday_rsa_key_contents = ''
|
|
) {
|
|
|
|
class { 'openstack_project::server':
|
|
iptables_public_tcp_ports => [22, 80, 443],
|
|
sysadmins => $sysadmins,
|
|
}
|
|
|
|
include openstack_project
|
|
class { 'jenkins::jenkinsuser':
|
|
ssh_key => $openstack_project::jenkins_ssh_key,
|
|
}
|
|
|
|
include apache
|
|
|
|
a2mod { 'rewrite':
|
|
ensure => present,
|
|
}
|
|
a2mod { 'proxy':
|
|
ensure => present,
|
|
}
|
|
a2mod { 'proxy_http':
|
|
ensure => present,
|
|
}
|
|
|
|
apache::vhost { 'tarballs.openstack.org':
|
|
port => 80,
|
|
priority => '50',
|
|
docroot => '/srv/static/tarballs',
|
|
require => File['/srv/static/tarballs'],
|
|
}
|
|
|
|
apache::vhost { 'ci.openstack.org':
|
|
port => 80,
|
|
priority => '50',
|
|
docroot => '/srv/static/ci',
|
|
require => File['/srv/static/ci'],
|
|
}
|
|
|
|
apache::vhost { 'logs.openstack.org':
|
|
port => 80,
|
|
priority => '50',
|
|
docroot => '/srv/static/logs',
|
|
require => File['/srv/static/logs'],
|
|
template => 'openstack_project/logs.vhost.erb',
|
|
}
|
|
|
|
apache::vhost { 'docs-draft.openstack.org':
|
|
port => 80,
|
|
priority => '50',
|
|
docroot => '/srv/static/docs-draft',
|
|
require => File['/srv/static/docs-draft'],
|
|
}
|
|
|
|
apache::vhost { 'status.openstack.org':
|
|
port => 80,
|
|
priority => '50',
|
|
docroot => '/srv/static/status',
|
|
template => 'openstack_project/status.vhost.erb',
|
|
require => File['/srv/static/status'],
|
|
}
|
|
|
|
file { '/srv/static':
|
|
ensure => directory,
|
|
}
|
|
|
|
file { '/srv/static/tarballs':
|
|
ensure => directory,
|
|
owner => 'jenkins',
|
|
group => 'jenkins',
|
|
require => User['jenkins'],
|
|
}
|
|
|
|
file { '/srv/static/ci':
|
|
ensure => directory,
|
|
owner => 'jenkins',
|
|
group => 'jenkins',
|
|
require => User['jenkins'],
|
|
}
|
|
|
|
file { '/srv/static/logs':
|
|
ensure => directory,
|
|
owner => 'jenkins',
|
|
group => 'jenkins',
|
|
require => User['jenkins'],
|
|
}
|
|
|
|
file { '/srv/static/logs/robots.txt':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0444',
|
|
source => 'puppet:///modules/openstack_project/disallow_robots.txt',
|
|
require => File['/srv/static/logs'],
|
|
}
|
|
|
|
file { '/srv/static/docs-draft':
|
|
ensure => directory,
|
|
}
|
|
|
|
file { '/srv/static/docs-draft/robots.txt':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0444',
|
|
source => 'puppet:///modules/openstack_project/disallow_robots.txt',
|
|
require => File['/srv/static/docs-draft'],
|
|
}
|
|
|
|
file { '/srv/static/status':
|
|
ensure => directory,
|
|
}
|
|
|
|
file { '/srv/static/status/index.html':
|
|
ensure => present,
|
|
source => 'puppet:///modules/openstack_project/status/index.html',
|
|
require => File['/srv/static/status'],
|
|
}
|
|
|
|
cron { 'gziplogs':
|
|
user => 'root',
|
|
minute => '0',
|
|
hour => '*/6',
|
|
command => 'sleep $((RANDOM\%600)) && flock -n /var/run/gziplogs.lock find /srv/static/logs/ -type f -not -name robots.txt -not -name \*.gz \( -name \*.txt -or -name \*.html -or -name tmp\* \) -exec gzip \{\} \;',
|
|
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
|
}
|
|
|
|
include reviewday
|
|
|
|
reviewday::site { 'reviewday.openstack.org':
|
|
git_url => 'https://github.com/openstack-infra/reviewday.git',
|
|
serveradmin => 'webmaster@openstack.org',
|
|
httproot => "/srv/static/${name}",
|
|
}
|
|
reviewday::init { 'reviewday.openstack.org':
|
|
gerrit_url => 'review.openstack.org',
|
|
gerrit_port => '29418',
|
|
gerrit_user => 'reviewday',
|
|
reviewday_gerrit_ssh_key => $reviewday_gerrit_ssh_key,
|
|
reviewday_rsa_pubkey_contents => $reviewday_rsa_pubkey_contents,
|
|
reviewday_rsa_key_contents => $reviewday_rsa_key_contents,
|
|
}
|
|
}
|