From bded3bc5a92bcc6d677850b731b6e95f7dc71b66 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 15 Oct 2014 11:58:28 +1100 Subject: [PATCH] Enable gzip compression on nodepool logs Add a .htaccess to the nodepool log directory to enable gzip compression for text/text mime-types; e.g. the quite large .log files that nodepool outputs there Change-Id: Ie0b269835ebb8effbac0285b782d8add7b47db32 --- modules/nodepool/files/nodepool-log.htaccess | 3 +++ modules/nodepool/manifests/init.pp | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 modules/nodepool/files/nodepool-log.htaccess diff --git a/modules/nodepool/files/nodepool-log.htaccess b/modules/nodepool/files/nodepool-log.htaccess new file mode 100644 index 0000000000..494e8a7abb --- /dev/null +++ b/modules/nodepool/files/nodepool-log.htaccess @@ -0,0 +1,3 @@ + +AddOutputFilterByType DEFLATE text/text + \ No newline at end of file diff --git a/modules/nodepool/manifests/init.pp b/modules/nodepool/manifests/init.pp index 9f282ed99c..ff268084bf 100644 --- a/modules/nodepool/manifests/init.pp +++ b/modules/nodepool/manifests/init.pp @@ -267,6 +267,17 @@ 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 {