-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Detect module dependencies when modules are not default-loaded #2598
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
base: main
Are you sure you want to change the base?
Conversation
Should this magically load dependencies, or should it display errors so people know to correct their code? I'm not sure I have a strong opinion there. Perhaps it could load, but also print an |
There's plenty of prior art of the puppet-module "acting on your behalf" in grabbing needed apache-modules. One for a quick example: puppetlabs-apache/manifests/vhost.pp Lines 2261 to 2263 in 1c72075
virtual_docroot (which defaults to false ), jump in and grab the apache-module that will make it work." This parallels what I'm looking for: 'demand an apache module when it is needed'. The difference is that a lot of the puppet module is built on the assumption that some of the apache modules are always there... and they don't have to be. Which is actually a bit odd, since the spec test
default_mods => false while most of the code is built with an unspoken assumption of default_mods => true
That all happens without an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Context
If you accept
default_mods => true
you get a -lot- of apache modules automatically. In my experience it's too many, which has led to us doingdefault_mods => []
to reduce the sprawl, and then adding back in what we need. That leads to a bit of whack-a-mole upon new server buildout, as a lot of this module's code assumes that you have included the default modules and it doesn't need to check. It also leads to "I'm not sure if I can remove this module" later, if you remove directives.Summary
This covers off the worst offenders I've hit in our environment:
mod_dir
,mod_autoindex
,mod_expires
,mod_dav
, andmod_cgi
. If you use vhost directory parameters that will invoke these module directives, vhost will try to make sure the module is loaded. If you're ondefault_mods => true
, this is a 'wasted' extra load; if you don't have the module loaded (say,default_mods => false
) then this brings the module in for you.Related Issues (if any)
N/A
Checklist
puppet apply
)