From a678f3df9775abf2aec903511d821992b31ab5dc Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 10 Aug 2022 13:43:20 +0200 Subject: [PATCH] Introduce an authz_core mod class This removes duplication in default mods and makes it easy to use without default mods. --- manifests/default_mods.pp | 16 +++------------- manifests/mod/authz_core.pp | 13 +++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 manifests/mod/authz_core.pp diff --git a/manifests/default_mods.pp b/manifests/default_mods.pp index 23c77360c0..43e402a843 100644 --- a/manifests/default_mods.pp +++ b/manifests/default_mods.pp @@ -114,6 +114,7 @@ } include apache::mod::alias include apache::mod::authn_file + include apache::mod::authz_core include apache::mod::autoindex include apache::mod::dav include apache::mod::dav_fs @@ -124,11 +125,6 @@ include apache::mod::setenvif include apache::mod::auth_basic - # authz_core is needed for 'Require' directive - ::apache::mod { 'authz_core': - id => 'authz_core_module', - } - # lots of stuff seems to break without access_compat ::apache::mod { 'access_compat': } @@ -138,14 +134,8 @@ } elsif $mods { ::apache::default_mods::load { $mods: } - # authz_core is needed for 'Require' directive - ::apache::mod { 'authz_core': - id => 'authz_core_module', - } + include apache::mod::authz_core } else { - # authz_core is needed for 'Require' directive - ::apache::mod { 'authz_core': - id => 'authz_core_module', - } + include apache::mod::authz_core } } diff --git a/manifests/mod/authz_core.pp b/manifests/mod/authz_core.pp new file mode 100644 index 0000000000..5992aabbe3 --- /dev/null +++ b/manifests/mod/authz_core.pp @@ -0,0 +1,13 @@ +# @summary +# Installs `mod_authz_core`. +# +# @param apache_version +# The version of apache being run. +# +# @see https://httpd.apache.org/docs/current/mod/mod_authz_core.html for additional documentation. +# +class apache::mod::authz_core { + apache::mod { 'authz_core': + id => 'authz_core_module', + } +}