Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use more mod classes in default_mods #2288

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions manifests/default_mods.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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': }
Expand All @@ -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
Expand All @@ -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': }
Expand All @@ -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
Expand All @@ -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': }

Expand All @@ -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
}
}
13 changes: 13 additions & 0 deletions manifests/mod/authz_core.pp
Original file line number Diff line number Diff line change
@@ -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',
}
}
2 changes: 2 additions & 0 deletions manifests/mod/deflate.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
}
) {
include apache
include apache::mod::filter

::apache::mod { 'deflate': }

file { 'deflate.conf':
Expand Down
1 change: 1 addition & 0 deletions spec/classes/mod/deflate_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"\
Expand Down