]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/manifests/mod/itk.pp
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / manifests / mod / itk.pp
1 class apache::mod::itk (
2   $startservers        = '8',
3   $minspareservers     = '5',
4   $maxspareservers     = '20',
5   $serverlimit         = '256',
6   $maxclients          = '256',
7   $maxrequestsperchild = '4000',
8   $apache_version      = $::apache::apache_version,
9 ) {
10   if defined(Class['apache::mod::event']) {
11     fail('May not include both apache::mod::itk and apache::mod::event on the same node')
12   }
13   if defined(Class['apache::mod::peruser']) {
14     fail('May not include both apache::mod::itk and apache::mod::peruser on the same node')
15   }
16   if versioncmp($apache_version, '2.4') < 0 {
17     if defined(Class['apache::mod::prefork']) {
18       fail('May not include both apache::mod::itk and apache::mod::prefork on the same node')
19     }
20   }
21   if defined(Class['apache::mod::worker']) {
22     fail('May not include both apache::mod::itk and apache::mod::worker on the same node')
23   }
24   File {
25     owner => 'root',
26     group => $::apache::params::root_group,
27     mode  => '0644',
28   }
29
30   # Template uses:
31   # - $startservers
32   # - $minspareservers
33   # - $maxspareservers
34   # - $serverlimit
35   # - $maxclients
36   # - $maxrequestsperchild
37   file { "${::apache::mod_dir}/itk.conf":
38     ensure  => file,
39     content => template('apache/mod/itk.conf.erb'),
40     require => Exec["mkdir ${::apache::mod_dir}"],
41     before  => File[$::apache::mod_dir],
42     notify  => Class['apache::service'],
43   }
44
45   case $::osfamily {
46     'debian', 'freebsd': {
47       apache::mpm{ 'itk':
48         apache_version => $apache_version,
49       }
50     }
51     'gentoo': {
52       ::portage::makeconf { 'apache2_mpms':
53         content => 'itk',
54       }
55     }
56     default: {
57       fail("Unsupported osfamily ${::osfamily}")
58     }
59   }
60 }