Puppet Class: apache::mod::pagespeed
- Defined in:
- manifests/mod/pagespeed.pp
Summary
Installs and manages mod_pagespeed, which is a Google module that rewrites web pages to reduce latency and bandwidth. This module does *not* manage the software repositories needed to automatically install the mod-pagespeed-stable package. The module does however require that the package be installed, or be installable using the system's default package provider. You should ensure that this pre-requisite is met or declaring `apache::mod::pagespeed` will cause the puppet run to fail.Overview
Note:
Verify that your system is compatible with the latest Google Pagespeed requirements.
Although this apache module requires the mod-pagespeed-stable package, Puppet does not manage the software repositories required to automatically install the package. If you declare this class when the package is either not installed or not available to your package manager, your Puppet run will fail.
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'manifests/mod/pagespeed.pp', line 157
class apache::mod::pagespeed (
String $inherit_vhost_config = 'on',
Boolean $filter_xhtml = false,
Stdlib::Absolutepath $cache_path = '/var/cache/mod_pagespeed/',
Stdlib::Absolutepath $log_dir = '/var/log/pagespeed',
Array $memcache_servers = [],
String $rewrite_level = 'CoreFilters',
Array $disable_filters = [],
Array $enable_filters = [],
Array $forbid_filters = [],
Integer $rewrite_deadline_per_flush_ms = 10,
Optional[String] $additional_domains = undef,
Integer $file_cache_size_kb = 102400,
Integer $file_cache_clean_interval_ms = 3600000,
Integer $lru_cache_per_process = 1024,
Integer $lru_cache_byte_limit = 16384,
Integer $css_flatten_max_bytes = 2048,
Integer $css_inline_max_bytes = 2048,
Integer $css_image_inline_max_bytes = 2048,
Integer $image_inline_max_bytes = 2048,
Integer $js_inline_max_bytes = 2048,
Integer $css_outline_min_bytes = 3000,
Integer $js_outline_min_bytes = 3000,
Integer $inode_limit = 500000,
Integer $image_max_rewrites_at_once = 8,
Integer $num_rewrite_threads = 4,
Integer $num_expensive_rewrite_threads = 4,
String $collect_statistics = 'on',
String $statistics_logging = 'on',
Array $allow_view_stats = [],
Array $allow_pagespeed_console = [],
Array $allow_pagespeed_message = [],
Integer $message_buffer_size = 100000,
Variant[Array, Hash] $additional_configuration = {},
Optional[String] $package_ensure = undef,
) {
include apache
apache::mod { 'pagespeed':
lib => 'mod_pagespeed_ap24.so',
package_ensure => $package_ensure,
}
$parameters = {
'inherit_vhost_config' => $inherit_vhost_config,
'filter_xhtml' => $filter_xhtml,
'cache_path' => $cache_path,
'log_dir' => $log_dir,
'memcache_servers' => $memcache_servers,
'rewrite_level' => $rewrite_level,
'disable_filters' => $disable_filters,
'enable_filters' => $enable_filters,
'forbid_filters' => $forbid_filters,
'rewrite_deadline_per_flush_ms' => $rewrite_deadline_per_flush_ms,
'additional_domains' => $additional_domains,
'file_cache_size_kb' => $file_cache_size_kb,
'file_cache_clean_interval_ms' => $file_cache_clean_interval_ms,
'lru_cache_per_process' => $lru_cache_per_process,
'lru_cache_byte_limit' => $lru_cache_byte_limit,
'css_flatten_max_bytes' => $css_flatten_max_bytes,
'css_inline_max_bytes' => $css_inline_max_bytes,
'css_image_inline_max_bytes' => $css_image_inline_max_bytes,
'image_inline_max_bytes' => $image_inline_max_bytes,
'js_inline_max_bytes' => $js_inline_max_bytes,
'css_outline_min_bytes' => $css_outline_min_bytes,
'js_outline_min_bytes' => $js_outline_min_bytes,
'inode_limit' => $inode_limit,
'image_max_rewrites_at_once' => $image_max_rewrites_at_once,
'num_rewrite_threads' => $num_rewrite_threads,
'num_expensive_rewrite_threads' => $num_expensive_rewrite_threads,
'collect_statistics' => $collect_statistics,
'allow_view_stats' => $allow_view_stats,
'statistics_logging' => $statistics_logging,
'allow_pagespeed_console' => $allow_pagespeed_console,
'message_buffer_size' => $message_buffer_size,
'allow_pagespeed_message' => $allow_pagespeed_message,
'additional_configuration' => $additional_configuration,
}
file { 'pagespeed.conf':
ensure => file,
path => "${apache::mod_dir}/pagespeed.conf",
mode => $apache::file_mode,
content => epp('apache/mod/pagespeed.conf.epp', $parameters),
require => Exec["mkdir ${apache::mod_dir}"],
before => File[$apache::mod_dir],
notify => Class['apache::service'],
}
}
|