puppetlabs-apache icon indicating copy to clipboard operation
puppetlabs-apache copied to clipboard

Add support for `IndexHeadInsert` for directories

Open trefzer opened this issue 1 year ago • 3 comments

Summary

add option IndexHeadInsert for directories

Additional Context

Option was missing ;)

Related Issues (if any)

trefzer avatar Apr 20 '24 17:04 trefzer

This option is also availabile in the global server config and virtual hosts. Do you want to add the corresponding parameters to this PR?

smortex avatar Apr 20 '24 19:04 smortex

@smortex there is no need to add this as a parameter to init.pp or vhost.pp since it is a value in the directory hash. (or do I missunderstand youre statement ?)

But another thing, that I realized, is that the options are only applied for provider == Directory (templates/vhost/_directories.erb line 33) which I think is wrong (at least the Index options seem to work for provider == Location on apache but not in puppet).

trefzer avatar Apr 21 '24 10:04 trefzer

@smortex there is no need to add this as a parameter to init.pp or vhost.pp since it is a value in the directory hash. (or do I missunderstand youre statement ?)

I am referring to https://httpd.apache.org/docs/current/mod/mod_autoindex.html#indexheadinsert, more specifically:

Context: server config, virtual host, directory, .htaccess

I understand that you can also set this at the vhost or server level so that you do not need to repeat the configuration for each directory. It may make sense to add another new parameter to both the apache and apache::vhost classes and the corresponding templates to allow setting this parameter at any supported location.

But another thing, that I realized, is that the options are only applied for provider == Directory (templates/vhost/_directories.erb line 33) which I think is wrong (at least the Index options seem to work for provider == Location on apache but not in puppet).

I am not sure to follow. <Location ...>, <Directory ...> etc are handled by the module through the directories parameter where each entry indicate which provider to use. It probably allows to build invalid configuration for apache that is accepted by Puppet (e.g. adding a IndexHeadInsert into a <Proxy ...>), but it goes beyond the scope of this PR and I don't think we should worry about this.

smortex avatar Apr 22 '24 01:04 smortex