diff modules/apache/manifests/default_mods.pp @ 437:b8d6ada284dd

Update Apache module to latest version Also converted some params to ints to match
author IBBoard <dev@ibboard.co.uk>
date Sun, 14 Aug 2022 11:30:13 +0100
parents d9352a684e62
children adf6fe9bbc17
line wrap: on
line diff
--- a/modules/apache/manifests/default_mods.pp	Wed Apr 19 18:45:23 2023 +0100
+++ b/modules/apache/manifests/default_mods.pp	Sun Aug 14 11:30:13 2022 +0100
@@ -3,26 +3,26 @@
 #
 # @api private
 class apache::default_mods (
-  $all            = true,
-  $mods           = undef,
-  $apache_version = $::apache::apache_version,
-  $use_systemd    = $::apache::use_systemd,
+  Boolean $all                                   = true,
+  Optional[Variant[Array[String], String]] $mods = undef,
+  String $apache_version                         = $apache::apache_version,
+  Boolean $use_systemd                           = $apache::use_systemd,
 ) {
   # These are modules required to run the default configuration.
   # They are not configurable at this time, so we just include
   # them to make sure it works.
-  case $::osfamily {
+  case $facts['os']['family'] {
     'redhat': {
       ::apache::mod { 'log_config': }
       if versioncmp($apache_version, '2.4') >= 0 {
         # Lets fork it
         # Do not try to load mod_systemd on RHEL/CentOS 6 SCL.
-        if ( !($::osfamily == 'redhat' and versioncmp($::operatingsystemrelease, '7.0') == -1) and !($::operatingsystem == 'Amazon') ) {
+        if ( !($facts['os']['family'] == 'redhat' and versioncmp($facts['os']['release']['major'], '7') == -1) and !($facts['os']['name'] == 'Amazon') ) {
           if ($use_systemd) {
             ::apache::mod { 'systemd': }
           }
         }
-        if ($::operatingsystem == 'Amazon' and $::operatingsystemrelease == '2') {
+        if ($facts['os']['name'] == 'Amazon' and $facts['os']['release']['full'] == '2') {
           ::apache::mod { 'systemd': }
         }
         ::apache::mod { 'unixd': }
@@ -37,7 +37,7 @@
     }
     default: {}
   }
-  case $::osfamily {
+  case $facts['os']['family'] {
     'gentoo': {}
     default: {
       ::apache::mod { 'authz_host': }
@@ -45,26 +45,26 @@
   }
   # The rest of the modules only get loaded if we want all modules enabled
   if $all {
-    case $::osfamily {
+    case $facts['os']['family'] {
       'debian': {
-        include ::apache::mod::authn_core
-        include ::apache::mod::reqtimeout
+        include apache::mod::authn_core
+        include apache::mod::reqtimeout
         if versioncmp($apache_version, '2.4') < 0 {
           ::apache::mod { 'authn_alias': }
         }
       }
       'redhat': {
-        include ::apache::mod::actions
-        include ::apache::mod::authn_core
-        include ::apache::mod::cache
-        include ::apache::mod::ext_filter
-        include ::apache::mod::mime
-        include ::apache::mod::mime_magic
-        include ::apache::mod::rewrite
-        include ::apache::mod::speling
-        include ::apache::mod::suexec
-        include ::apache::mod::version
-        include ::apache::mod::vhost_alias
+        include apache::mod::actions
+        include apache::mod::authn_core
+        include apache::mod::cache
+        include apache::mod::ext_filter
+        include apache::mod::mime
+        include apache::mod::mime_magic
+        include apache::mod::rewrite
+        include apache::mod::speling
+        include apache::mod::suexec
+        include apache::mod::version
+        include apache::mod::vhost_alias
         ::apache::mod { 'auth_digest': }
         ::apache::mod { 'authn_anon': }
         ::apache::mod { 'authn_dbm': }
@@ -82,20 +82,20 @@
         }
       }
       'freebsd': {
-        include ::apache::mod::actions
-        include ::apache::mod::authn_core
-        include ::apache::mod::cache
-        include ::apache::mod::disk_cache
-        include ::apache::mod::headers
-        include ::apache::mod::info
-        include ::apache::mod::mime_magic
-        include ::apache::mod::reqtimeout
-        include ::apache::mod::rewrite
-        include ::apache::mod::userdir
-        include ::apache::mod::version
-        include ::apache::mod::vhost_alias
-        include ::apache::mod::speling
-        include ::apache::mod::filter
+        include apache::mod::actions
+        include apache::mod::authn_core
+        include apache::mod::cache
+        include apache::mod::disk_cache
+        include apache::mod::headers
+        include apache::mod::info
+        include apache::mod::mime_magic
+        include apache::mod::reqtimeout
+        include apache::mod::rewrite
+        include apache::mod::userdir
+        include apache::mod::version
+        include apache::mod::vhost_alias
+        include apache::mod::speling
+        include apache::mod::filter
 
         ::apache::mod { 'asis': }
         ::apache::mod { 'auth_digest': }
@@ -109,7 +109,7 @@
         ::apache::mod { 'dumpio': }
         ::apache::mod { 'expires': }
         ::apache::mod { 'file_cache': }
-        ::apache::mod { 'imagemap':}
+        ::apache::mod { 'imagemap': }
         ::apache::mod { 'include': }
         ::apache::mod { 'logio': }
         ::apache::mod { 'request': }
@@ -118,32 +118,32 @@
       }
       default: {}
     }
-    case $::apache::mpm_module {
+    case $apache::mpm_module {
       'prefork': {
-        include ::apache::mod::cgi
+        include apache::mod::cgi
       }
       'worker': {
-        include ::apache::mod::cgid
+        include apache::mod::cgid
       }
       default: {
         # do nothing
       }
     }
-    include ::apache::mod::alias
-    include ::apache::mod::authn_file
-    include ::apache::mod::autoindex
-    include ::apache::mod::dav
-    include ::apache::mod::dav_fs
-    include ::apache::mod::deflate
-    include ::apache::mod::dir
-    include ::apache::mod::mime
-    include ::apache::mod::negotiation
-    include ::apache::mod::setenvif
+    include apache::mod::alias
+    include apache::mod::authn_file
+    include apache::mod::autoindex
+    include apache::mod::dav
+    include apache::mod::dav_fs
+    include apache::mod::deflate
+    include apache::mod::dir
+    include apache::mod::mime
+    include apache::mod::negotiation
+    include apache::mod::setenvif
     ::apache::mod { 'auth_basic': }
 
     if versioncmp($apache_version, '2.4') >= 0 {
       # filter is needed by mod_deflate
-      include ::apache::mod::filter
+      include apache::mod::filter
 
       # authz_core is needed for 'Require' directive
       ::apache::mod { 'authz_core':
@@ -153,13 +153,12 @@
       # lots of stuff seems to break without access_compat
       ::apache::mod { 'access_compat': }
     } else {
-      include ::apache::mod::authz_default
+      include apache::mod::authz_default
     }
 
-    include ::apache::mod::authz_user
-
-    ::apache::mod { 'authz_groupfile': }
-    include ::apache::mod::env
+    include apache::mod::authz_user
+    include apache::mod::authz_groupfile
+    include apache::mod::env
   } elsif $mods {
     ::apache::default_mods::load { $mods: }
 
@@ -170,7 +169,7 @@
       }
 
       # filter is needed by mod_deflate
-      include ::apache::mod::filter
+      include apache::mod::filter
     }
   } else {
     if versioncmp($apache_version, '2.4') >= 0 {
@@ -180,7 +179,7 @@
       }
 
       # filter is needed by mod_deflate
-      include ::apache::mod::filter
+      include apache::mod::filter
     }
   }
 }