Add files01.openstack.org
Change-Id: Ia2f5e365621e0bef65863b7b15daebb207e42493
This commit is contained in:
parent
3dae0f1edb
commit
0aeac8e91d
@ -289,6 +289,7 @@ cacti_hosts:
|
||||
- elasticsearch07.openstack.org
|
||||
- etherpad-dev.openstack.org
|
||||
- etherpad.openstack.org
|
||||
- files01.openstack.org
|
||||
- firehose01.openstack.org
|
||||
- git.openstack.org
|
||||
- git01.openstack.org
|
||||
|
@ -601,6 +601,22 @@ node 'design-summit-prep.openstack.org' {
|
||||
}
|
||||
}
|
||||
|
||||
# Serve static AFS content for docs and other sites.
|
||||
# Node-OS: trusty
|
||||
node 'files01.openstack.org' {
|
||||
class { 'openstack_project::server':
|
||||
iptables_public_tcp_ports => [22, 80],
|
||||
sysadmins => hiera('sysadmins', []),
|
||||
afs => true,
|
||||
afs_cache_size => 10000000, # 10GB
|
||||
}
|
||||
|
||||
class { 'openstack_project::files':
|
||||
vhost_name => 'files.openstack.org',
|
||||
require => Class['Openstack_project::Server'],
|
||||
}
|
||||
}
|
||||
|
||||
# Node-OS: trusty
|
||||
node 'refstack.openstack.org' {
|
||||
class { 'openstack_project::server':
|
||||
|
52
modules/openstack_project/manifests/files.pp
Normal file
52
modules/openstack_project/manifests/files.pp
Normal file
@ -0,0 +1,52 @@
|
||||
# == Class: openstack_project::files
|
||||
#
|
||||
class openstack_project::files (
|
||||
$vhost_name = $::fqdn,
|
||||
) {
|
||||
|
||||
$afs_root = '/afs/openstack.org/'
|
||||
$www_base = '/var/www'
|
||||
|
||||
#####################################################
|
||||
# Build Apache Webroot
|
||||
file { "${www_base}":
|
||||
ensure => directory,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
|
||||
file { "${www_base}/robots.txt":
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0444',
|
||||
source => 'puppet:///modules/openstack_project/disallow_robots.txt',
|
||||
require => File["${www_base}"],
|
||||
}
|
||||
|
||||
#####################################################
|
||||
# Build VHost
|
||||
include ::httpd
|
||||
|
||||
::httpd::vhost { $vhost_name:
|
||||
port => 80,
|
||||
priority => '50',
|
||||
docroot => "${afs_root}",
|
||||
template => 'openstack_project/files.vhost.erb',
|
||||
require => [
|
||||
File["${www_base}"],
|
||||
]
|
||||
}
|
||||
|
||||
class { '::httpd::logrotate':
|
||||
options => [
|
||||
'daily',
|
||||
'missingok',
|
||||
'rotate 7',
|
||||
'compress',
|
||||
'delaycompress',
|
||||
'notifempty',
|
||||
'create 640 root adm',
|
||||
],
|
||||
}
|
||||
}
|
31
modules/openstack_project/templates/files.vhost.erb
Normal file
31
modules/openstack_project/templates/files.vhost.erb
Normal file
@ -0,0 +1,31 @@
|
||||
# ************************************
|
||||
# Managed by Puppet
|
||||
# ************************************
|
||||
|
||||
NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
||||
<VirtualHost <%= @vhost_name %>:<%= @port %>>
|
||||
ServerName <%= @srvname %>
|
||||
<% if @serveraliases.is_a? Array -%>
|
||||
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||
<% elsif @serveraliases != nil -%>
|
||||
<%= " ServerAlias #{@serveraliases}" -%>
|
||||
<% end -%>
|
||||
|
||||
DocumentRoot <%= @docroot %>
|
||||
<Directory <%= @docroot %>>
|
||||
Satisfy any
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
Alias /robots.txt /var/www/robots.txt
|
||||
<Directory "/var/www/robots.txt">
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
|
||||
LogLevel warn
|
||||
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined
|
||||
ServerSignature Off
|
||||
</VirtualHost>
|
Loading…
Reference in New Issue
Block a user