diff --git a/manifests/default_mods.pp b/manifests/default_mods.pp index a6dfd368cf..43e402a843 100644 --- a/manifests/default_mods.pp +++ b/manifests/default_mods.pp @@ -48,6 +48,7 @@ include apache::mod::authn_core include apache::mod::cache include apache::mod::ext_filter + include apache::mod::include include apache::mod::mime include apache::mod::mime_magic include apache::mod::rewrite @@ -60,7 +61,6 @@ ::apache::mod { 'authz_dbm': } ::apache::mod { 'authz_owner': } ::apache::mod { 'expires': } - ::apache::mod { 'include': } ::apache::mod { 'logio': } ::apache::mod { 'substitute': } ::apache::mod { 'usertrack': } @@ -71,6 +71,7 @@ include apache::mod::cache include apache::mod::disk_cache include apache::mod::headers + include apache::mod::include include apache::mod::info include apache::mod::mime_magic include apache::mod::reqtimeout @@ -93,7 +94,6 @@ ::apache::mod { 'expires': } ::apache::mod { 'file_cache': } ::apache::mod { 'imagemap': } - ::apache::mod { 'include': } ::apache::mod { 'logio': } ::apache::mod { 'request': } ::apache::mod { 'session': } @@ -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,14 +125,6 @@ include apache::mod::setenvif include apache::mod::auth_basic - # filter is needed by mod_deflate - include apache::mod::filter - - # 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': } @@ -141,20 +134,8 @@ } elsif $mods { ::apache::default_mods::load { $mods: } - # authz_core is needed for 'Require' directive - ::apache::mod { 'authz_core': - id => 'authz_core_module', - } - - # filter is needed by mod_deflate - include apache::mod::filter + include apache::mod::authz_core } else { - # authz_core is needed for 'Require' directive - ::apache::mod { 'authz_core': - id => 'authz_core_module', - } - - # filter is needed by mod_deflate - include apache::mod::filter + 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', + } +} diff --git a/manifests/mod/deflate.pp b/manifests/mod/deflate.pp index c5a6aaac8a..cf5f9e0b1f 100644 --- a/manifests/mod/deflate.pp +++ b/manifests/mod/deflate.pp @@ -24,6 +24,8 @@ } ) { include apache + include apache::mod::filter + ::apache::mod { 'deflate': } file { 'deflate.conf': diff --git a/spec/classes/mod/deflate_spec.rb b/spec/classes/mod/deflate_spec.rb index 96ecaa0f82..d9f4056bcc 100644 --- a/spec/classes/mod/deflate_spec.rb +++ b/spec/classes/mod/deflate_spec.rb @@ -5,6 +5,7 @@ # This function is called inside the OS specific contexts def general_deflate_specs it { is_expected.to contain_apache__mod('deflate') } + it { is_expected.to contain_class('apache::mod::filter') } expected = "AddOutputFilterByType DEFLATE application/rss+xml\n"\ "AddOutputFilterByType DEFLATE application/x-javascript\n"\