Puppet Class: apache::mod::peruser

Defined in:
manifests/mod/peruser.pp

Summary

Installs `mod_peruser`.

Overview

TODO:

Add docs

Parameters:

  • minspareprocessors (Any) (defaults to: '2')
  • minprocessors (Any) (defaults to: '2')
  • maxprocessors (Any) (defaults to: '10')
  • maxclients (Any) (defaults to: '150')
  • maxrequestsperchild (Any) (defaults to: '1000')
  • idletimeout (Any) (defaults to: '120')
  • expiretimeout (Any) (defaults to: '120')
  • keepalive (Any) (defaults to: 'Off')


6
7
8
9
10
11
12
13
14
15
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
76
77
78
79
80
81
82
# File 'manifests/mod/peruser.pp', line 6

class apache::mod::peruser (
  $minspareprocessors = '2',
  $minprocessors = '2',
  $maxprocessors = '10',
  $maxclients = '150',
  $maxrequestsperchild = '1000',
  $idletimeout = '120',
  $expiretimeout = '120',
  $keepalive = 'Off',
) {
  include ::apache
  case $::osfamily {
    'freebsd' : {
      fail("Unsupported osfamily ${::osfamily}")
    }
    default: {
      if $::osfamily == 'gentoo' {
        ::portage::makeconf { 'apache2_mpms':
          content => 'peruser',
        }
      }

      if defined(Class['apache::mod::event']) {
        fail('May not include both apache::mod::peruser and apache::mod::event on the same node')
      }
      if defined(Class['apache::mod::itk']) {
        fail('May not include both apache::mod::peruser and apache::mod::itk on the same node')
      }
      if defined(Class['apache::mod::prefork']) {
        fail('May not include both apache::mod::peruser and apache::mod::prefork on the same node')
      }
      if defined(Class['apache::mod::worker']) {
        fail('May not include both apache::mod::peruser and apache::mod::worker on the same node')
      }
      File {
        owner => 'root',
        group => $::apache::params::root_group,
        mode  => $::apache::file_mode,
      }

      $mod_dir = $::apache::mod_dir

      # Template uses:
      # - $minspareprocessors
      # - $minprocessors
      # - $maxprocessors
      # - $maxclients
      # - $maxrequestsperchild
      # - $idletimeout
      # - $expiretimeout
      # - $keepalive
      # - $mod_dir
      file { "${::apache::mod_dir}/peruser.conf":
        ensure  => file,
        mode    => $::apache::file_mode,
        content => template('apache/mod/peruser.conf.erb'),
        require => Exec["mkdir ${::apache::mod_dir}"],
        before  => File[$::apache::mod_dir],
        notify  => Class['apache::service'],
      }
      file { "${::apache::mod_dir}/peruser":
        ensure  => directory,
        require => File[$::apache::mod_dir],
      }
      file { "${::apache::mod_dir}/peruser/multiplexers":
        ensure  => directory,
        require => File["${::apache::mod_dir}/peruser"],
      }
      file { "${::apache::mod_dir}/peruser/processors":
        ensure  => directory,
        require => File["${::apache::mod_dir}/peruser"],
      }

      ::apache::peruser::multiplexer { '01-default': }
    }
  }
}