Puppet Class: apache::mod::pagespeed

Defined in:
manifests/mod/pagespeed.pp

Summary

Installs and configures `mod_pagespeed`.

Overview

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.

Note:

Verify that your system is compatible with the latest Google Pagespeed requirements.

TODO:

Add docs

Parameters:

  • inherit_vhost_config (Any) (defaults to: 'on')
  • filter_xhtml (Any) (defaults to: false)
  • cache_path (Any) (defaults to: '/var/cache/mod_pagespeed/')
  • log_dir (Any) (defaults to: '/var/log/pagespeed')
  • memcache_servers (Any) (defaults to: [])
  • rewrite_level (Any) (defaults to: 'CoreFilters')
  • disable_filters (Any) (defaults to: [])
  • enable_filters (Any) (defaults to: [])
  • forbid_filters (Any) (defaults to: [])
  • rewrite_deadline_per_flush_ms (Any) (defaults to: 10)
  • additional_domains (Any) (defaults to: undef)
  • file_cache_size_kb (Any) (defaults to: 102400)
  • file_cache_clean_interval_ms (Any) (defaults to: 3600000)
  • lru_cache_per_process (Any) (defaults to: 1024)
  • lru_cache_byte_limit (Any) (defaults to: 16384)
  • css_flatten_max_bytes (Any) (defaults to: 2048)
  • css_inline_max_bytes (Any) (defaults to: 2048)
  • css_image_inline_max_bytes (Any) (defaults to: 2048)
  • image_inline_max_bytes (Any) (defaults to: 2048)
  • js_inline_max_bytes (Any) (defaults to: 2048)
  • css_outline_min_bytes (Any) (defaults to: 3000)
  • js_outline_min_bytes (Any) (defaults to: 3000)
  • inode_limit (Any) (defaults to: 500000)
  • image_max_rewrites_at_once (Any) (defaults to: 8)
  • num_rewrite_threads (Any) (defaults to: 4)
  • num_expensive_rewrite_threads (Any) (defaults to: 4)
  • collect_statistics (Any) (defaults to: 'on')
  • statistics_logging (Any) (defaults to: 'on')
  • allow_view_stats (Any) (defaults to: [])
  • allow_pagespeed_console (Any) (defaults to: [])
  • allow_pagespeed_message (Any) (defaults to: [])
  • message_buffer_size (Any) (defaults to: 100000)
  • additional_configuration (Any) (defaults to: {})
  • apache_version (Any) (defaults to: undef)
  • package_ensure (Any) (defaults to: undef)

See Also:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'manifests/mod/pagespeed.pp', line 16

class apache::mod::pagespeed (
  $inherit_vhost_config          = 'on',
  $filter_xhtml                  = false,
  $cache_path                    = '/var/cache/mod_pagespeed/',
  $log_dir                       = '/var/log/pagespeed',
  $memcache_servers              = [],
  $rewrite_level                 = 'CoreFilters',
  $disable_filters               = [],
  $enable_filters                = [],
  $forbid_filters                = [],
  $rewrite_deadline_per_flush_ms = 10,
  $additional_domains            = undef,
  $file_cache_size_kb            = 102400,
  $file_cache_clean_interval_ms  = 3600000,
  $lru_cache_per_process         = 1024,
  $lru_cache_byte_limit          = 16384,
  $css_flatten_max_bytes         = 2048,
  $css_inline_max_bytes          = 2048,
  $css_image_inline_max_bytes    = 2048,
  $image_inline_max_bytes        = 2048,
  $js_inline_max_bytes           = 2048,
  $css_outline_min_bytes         = 3000,
  $js_outline_min_bytes          = 3000,
  $inode_limit                   = 500000,
  $image_max_rewrites_at_once    = 8,
  $num_rewrite_threads           = 4,
  $num_expensive_rewrite_threads = 4,
  $collect_statistics            = 'on',
  $statistics_logging            = 'on',
  $allow_view_stats              = [],
  $allow_pagespeed_console       = [],
  $allow_pagespeed_message       = [],
  $message_buffer_size           = 100000,
  $additional_configuration      = {},
  $apache_version                = undef,
  $package_ensure                = undef,
){
  include ::apache
  $_apache_version = pick($apache_version, $apache::apache_version)
  $_lib = $_apache_version ? {
    '2.4'   => 'mod_pagespeed_ap24.so',
    default => undef
  }

  apache::mod { 'pagespeed':
    lib            => $_lib,
    package_ensure => $package_ensure,
  }

  # Template uses $_apache_version
  file { 'pagespeed.conf':
    ensure  => file,
    path    => "${::apache::mod_dir}/pagespeed.conf",
    mode    => $::apache::file_mode,
    content => template('apache/mod/pagespeed.conf.erb'),
    require => Exec["mkdir ${::apache::mod_dir}"],
    before  => File[$::apache::mod_dir],
    notify  => Class['apache::service'],
  }
}