Deploy vhost template for nodepool.o.o logs

In Ie0b269835ebb8effbac0285b782d8add7b47db32 I didn't consider how
difficult it is to get puppet to put in AllowOverride directives to
allow .htaccess to work.  The puppetlabs-apache version we use does
not support "override" as an argument, so you can't easily add this to
allow apache to read htaccess.  Upgrading is a big task because we are
so far behind (see I6fa5f3275a84ec4480169de562d1d4a656111814).

So deploy a full template for nodepool vhost that includes the config
options we need.

Additionally, the existing mimetype isn't set for the log-files

---
 $ curl -I http://nodepool.openstack.org/image.log.2014-10-14
 HTTP/1.1 200 OK
 Date: Fri, 17 Oct 2014 00:02:39 GMT
 Server: Apache/2.2.22 (Ubuntu)
 Last-Modified: Tue, 14 Oct 2014 23:59:56 GMT
 ETag: "f89bb-d458315-5056acfe33700"
 Accept-Ranges: bytes
 Content-Length: 222659349
---

I'm pretty sure this means it defaults to text/plain, but this makes
it explicit.  This should also matches on the timestampped log files
per the rules of multiple extensions [1]

[1] http://httpd.apache.org/docs/2.2/mod/mod_mime.html#multipleext

Change-Id: I7fa2603f4160b06af71a515e655d4a705fa0c768
This commit is contained in:
Ian Wienand 2014-10-17 11:16:09 +11:00
parent f3e71467b8
commit 2faf92404e
3 changed files with 24 additions and 15 deletions

View File

@ -1,3 +0,0 @@
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text
</IfModule>

View File

@ -252,7 +252,8 @@ class nodepool (
apache::vhost { $vhost_name:
port => 80,
priority => '50',
docroot => $image_log_document_root,
docroot => 'MEANINGLESS_ARGUMENT',
template => 'nodepool/nodepool-log.vhost.erb',
}
if $image_log_document_root != '/var/log/nodepool' {
@ -267,17 +268,6 @@ class nodepool (
],
}
}
# htaccess to enable the large .log files to send with gzip
# compression
file { "${image_log_document_root}/.htaccess":
ensure => present,
source => 'puppet:///modules/nodepool/nodepool-log.htaccess',
mode => '0644',
owner => 'nodepool',
group => 'nodepool',
require => File[$image_log_document_root],
}
}
if $sudo == true {

View File

@ -0,0 +1,22 @@
<VirtualHost <%= scope.lookupvar("nodepool::vhost_name") %>:80>
DocumentRoot <%= scope.lookupvar("nodepool:image_log_document_root") %>
<Directory>
Options <%= scope.lookupvar("apache::params::options") %>
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/nodepool_error.log
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("apache::params::apache_name") %>/nodepool_access.log combined
ServerSignature Off
AddType text/plain .log
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
</IfModule>
</VirtualHost>