diff modules/apache/manifests/mod/prefork.pp @ 275:d9352a684e62

Mass update of modules to remove deprecation warnings
author IBBoard <dev@ibboard.co.uk>
date Sun, 26 Jan 2020 11:36:07 +0000
parents 675c1cc61eaf
children b8d6ada284dd
line wrap: on
line diff
--- a/modules/apache/manifests/mod/prefork.pp	Sat Jan 04 11:42:45 2020 +0000
+++ b/modules/apache/manifests/mod/prefork.pp	Sun Jan 26 11:36:07 2020 +0000
@@ -1,11 +1,49 @@
+# @summary
+#   Installs and configures MPM `prefork`.
+# 
+# @param startservers
+#   Number of child server processes created at startup.
+#
+# @param minspareservers
+#   Minimum number of idle child server processes.
+# 
+# @param maxspareservers
+#   Maximum number of idle child server processes.
+# 
+# @param serverlimit
+#   Upper limit on configurable number of processes.
+# 
+# @param maxclients
+#   Old alias for MaxRequestWorkers.
+# 
+# @param maxrequestworkers
+#   Maximum number of connections that will be processed simultaneously.
+# 
+# @param maxrequestsperchild
+#  Old alias for MaxConnectionsPerChild.
+# 
+# @param maxconnectionsperchild
+#   Limit on the number of connections that an individual child server will handle during its life.
+#
+# @param apache_version
+#   Used to verify that the Apache version you have requested is compatible with the module.
+#
+# @param listenbacklog
+#   Maximum length of the queue of pending connections.
+# 
+# @see https://httpd.apache.org/docs/current/mod/prefork.html for additional documentation.
+#
 class apache::mod::prefork (
-  $startservers        = '8',
-  $minspareservers     = '5',
-  $maxspareservers     = '20',
-  $serverlimit         = '256',
-  $maxclients          = '256',
-  $maxrequestsperchild = '4000',
-  $apache_version      = undef,
+  $startservers           = '8',
+  $minspareservers        = '5',
+  $maxspareservers        = '20',
+  $serverlimit            = '256',
+  $maxclients             = '256',
+  $maxrequestworkers      = undef,
+  $maxrequestsperchild    = '4000',
+  $maxconnectionsperchild = undef,
+  $apache_version         = undef,
+  $listenbacklog          = '511'
 ) {
   include ::apache
   $_apache_version = pick($apache_version, $apache::apache_version)
@@ -23,6 +61,15 @@
   if defined(Class['apache::mod::worker']) {
     fail('May not include both apache::mod::prefork and apache::mod::worker on the same node')
   }
+
+  if versioncmp($_apache_version, '2.3.13') < 0 {
+    if $maxrequestworkers == undef {
+      warning("For newer versions of Apache, \$maxclients is deprecated, please use \$maxrequestworkers.")
+    } elsif $maxconnectionsperchild == undef {
+      warning("For newer versions of Apache, \$maxrequestsperchild is deprecated, please use \$maxconnectionsperchild.")
+    }
+  }
+
   File {
     owner => 'root',
     group => $::apache::params::root_group,
@@ -35,7 +82,9 @@
   # - $maxspareservers
   # - $serverlimit
   # - $maxclients
+  # - $maxrequestworkers
   # - $maxrequestsperchild
+  # - $maxconnectionsperchild
   file { "${::apache::mod_dir}/prefork.conf":
     ensure  => file,
     content => template('apache/mod/prefork.conf.erb'),