comparison modules/apache/manifests/mod/prefork.pp @ 0:956e484adc12

Initial public release of Puppet configs
author IBBoard <dev@ibboard.co.uk>
date Sat, 16 Aug 2014 19:47:38 +0000
parents
children 37675581a273
comparison
equal deleted inserted replaced
-1:000000000000 0:956e484adc12
1 class apache::mod::prefork (
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::prefork and apache::mod::event on the same node')
12 }
13 if defined(Class['apache::mod::itk']) {
14 fail('May not include both apache::mod::prefork and apache::mod::itk on the same node')
15 }
16 if defined(Class['apache::mod::peruser']) {
17 fail('May not include both apache::mod::prefork and apache::mod::peruser on the same node')
18 }
19 if defined(Class['apache::mod::worker']) {
20 fail('May not include both apache::mod::prefork and apache::mod::worker on the same node')
21 }
22 File {
23 owner => 'root',
24 group => $::apache::params::root_group,
25 mode => '0644',
26 }
27
28 # Template uses:
29 # - $startservers
30 # - $minspareservers
31 # - $maxspareservers
32 # - $serverlimit
33 # - $maxclients
34 # - $maxrequestsperchild
35 file { "${::apache::mod_dir}/prefork.conf":
36 ensure => file,
37 content => template('apache/mod/prefork.conf.erb'),
38 require => Exec["mkdir ${::apache::mod_dir}"],
39 before => File[$::apache::mod_dir],
40 notify => Service['httpd'],
41 }
42
43 case $::osfamily {
44 'redhat': {
45 if $apache_version >= 2.4 {
46 ::apache::mpm{ 'prefork':
47 apache_version => $apache_version,
48 }
49 }
50 else {
51 file_line { '/etc/sysconfig/httpd prefork enable':
52 ensure => present,
53 path => '/etc/sysconfig/httpd',
54 line => '#HTTPD=/usr/sbin/httpd.worker',
55 match => '#?HTTPD=/usr/sbin/httpd.worker',
56 require => Package['httpd'],
57 notify => Service['httpd'],
58 }
59 }
60 }
61 'debian', 'freebsd' : {
62 ::apache::mpm{ 'prefork':
63 apache_version => $apache_version,
64 }
65 }
66 default: {
67 fail("Unsupported osfamily ${::osfamily}")
68 }
69 }
70 }