Puppet Class: apache::mod::event

Defined in:
manifests/mod/event.pp

Overview

Parameters:

  • startservers (Any) (defaults to: '2')
  • maxclients (Any) (defaults to: '150')
  • maxrequestworkers (Any) (defaults to: undef)
  • minsparethreads (Any) (defaults to: '25')
  • maxsparethreads (Any) (defaults to: '75')
  • threadsperchild (Any) (defaults to: '25')
  • maxrequestsperchild (Any) (defaults to: '0')
  • maxconnectionsperchild (Any) (defaults to: undef)
  • serverlimit (Any) (defaults to: '25')
  • apache_version (Any) (defaults to: $::apache::apache_version)
  • threadlimit (Any) (defaults to: '64')
  • listenbacklog (Any) (defaults to: '511')


1
2
3
4
5
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
# File 'manifests/mod/event.pp', line 1

class apache::mod::event (
  $startservers           = '2',
  $maxclients             = '150',
  $maxrequestworkers      = undef,
  $minsparethreads        = '25',
  $maxsparethreads        = '75',
  $threadsperchild        = '25',
  $maxrequestsperchild    = '0',
  $maxconnectionsperchild = undef,
  $serverlimit            = '25',
  $apache_version         = $::apache::apache_version,
  $threadlimit            = '64',
  $listenbacklog          = '511',
) {
  if defined(Class['apache::mod::itk']) {
    fail('May not include both apache::mod::event and apache::mod::itk on the same node')
  }
  if defined(Class['apache::mod::peruser']) {
    fail('May not include both apache::mod::event and apache::mod::peruser on the same node')
  }
  if defined(Class['apache::mod::prefork']) {
    fail('May not include both apache::mod::event and apache::mod::prefork on the same node')
  }
  if defined(Class['apache::mod::worker']) {
    fail('May not include both apache::mod::event and apache::mod::worker on the same node')
  }
  File {
    owner => 'root',
    group => $::apache::params::root_group,
    mode  => $::apache::file_mode,
  }

  # Template uses:
  # - $startservers
  # - $maxclients
  # - $minsparethreads
  # - $maxsparethreads
  # - $threadsperchild
  # - $maxrequestsperchild
  # - $serverlimit
  file { "${::apache::mod_dir}/event.conf":
    ensure  => file,
    mode    => $::apache::file_mode,
    content => template('apache/mod/event.conf.erb'),
    require => Exec["mkdir ${::apache::mod_dir}"],
    before  => File[$::apache::mod_dir],
    notify  => Class['apache::service'],
  }

  case $::osfamily {
    'redhat': {
      if versioncmp($apache_version, '2.4') >= 0 {
        apache::mpm{ 'event':
          apache_version => $apache_version,
        }
      }
    }
    'debian','freebsd' : {
      apache::mpm{ 'event':
        apache_version => $apache_version,
      }
    }
    'gentoo': {
      ::portage::makeconf { 'apache2_mpms':
        content => 'event',
      }
    }
    default: {
      fail("Unsupported osfamily ${::osfamily}")
    }
  }
}