-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add Hash $vhosts_defaults to apache::vhosts class? #2325
Comments
Thanks @janit42 for creating issue. I started looking into this but somehow I was not able to get the full context on above feature, can you please given some context around it and also will be helpful if you can put one of example for better understanding? |
this add the possibility to pass vhosts_defaults to the class for enforcing some site-wide vhost stanards e.g. via Hiera or to significantly shorten the content of on nodes hosting many vhosts (puppetlabs#2325)
this add the possibility to pass vhosts_defaults to the class for enforcing some site-wide vhost stanards e.g. via Hiera or to significantly shorten the content of on nodes hosting many vhosts (puppetlabs#2325)
this add the possibility to pass vhosts_defaults to the class for enforcing some site-wide vhost stanards e.g. via Hiera or to significantly shorten the content of on nodes hosting many vhosts (puppetlabs#2325)
Thanks for your reply @Ramesh7 ! I've created an updated version of the apache::vhosts class in janit42@91ad6e6 and tried to expand the classes docs with a description and an example for the usage of the proposed parameter. In principle, I would enable the apache::vhosts class to pass resource defaults for the internally used create_resources function The new parameter could be used on nodes with a high number of relatively uniform vhosts to pass common vhosts_settings only once through the vhosts_defaults hash instead of writing the same attribute to every single vhost explicitly. It could be even used, when preset in Hiera via a data/common.yaml file to set site-wide defaults, e.g. if a company policy required masking clients ip-addresses in logfiles, this could be done via setting this in the vhosts_defaults hash in Hiera, so nobody can setup a vhost for whatever service through the apache::vhosts class and forget to activate that setting (this is shown as an example in the commit referenced above). Does that clarify the idea enough? If so, do you think I could create a pull-request from the referenced commit? |
Thanks @janit42 for your quick response. BTW not sure if I am missing here but these
I would be grateful if you could retrieve the pull request associated with the commit. |
class apache::vhosts (
Hash $vhosts = {},
Hash $vhosts_defaults = {},
) {
include apache
create_resources('apache::vhost', $vhosts, $vhosts_defaults)
} |
Got it, Thanks @ekohl for correcting me. |
this add the possibility to pass vhosts_defaults to the class for enforcing some site-wide vhost stanards e.g. via Hiera or to significantly shorten the content of on nodes hosting many vhosts (puppetlabs#2325)
You can use :
|
I think Having said that, #2325 (comment) already has the code. If anyone feels like it, they should submit a patch to https://github.com/puppetlabs/puppetlabs-apache/blob/main/manifests/vhosts.pp. |
But class apache is declared and Apache httpd server is installed without vhosts... is this really necessary? |
Use Case
In our environment we have a some per-vhosts-settings which are identical in multiple vhosts. Therefore it would be great to be able to set defaults for multiple vhosts through the apache::vhosts class.
Describe the Solution You Would Like
add a parameter to the apache::vhosts class, that would be passed to the create_resources function:
Hash $vhosts_defaults = {},
Describe Alternatives You've Considered
Alternatively it would be possible to use resource defaults, but we have a Hiera-heavy setup on some nodes, where we just define the apache::vhosts::vhosts in Hiera and include the apache::vhosts class to make sure these get picked up and that would work more smoothly with a $vhosts_defaults parameter.
Additional Context
If there was nothing against implementing such a defaults Hash in principle, I'd try to create a pull request.
The text was updated successfully, but these errors were encountered: