Skip to content

Commit cc66b93

Browse files
committed
Fix apache::vhost::error_documents data type
The template in templates/vhost/_error_document.erb is only functionnal if we pass an array of hashes. This is going to be simplified in a future commit so only accept values that produce working configuration and reject configuration that is invalid and ignored.
1 parent b01fab4 commit cc66b93

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

manifests/vhost.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@
17981798
Optional[Variant[String, Boolean]] $modsec_audit_log = undef,
17991799
Optional[String] $modsec_audit_log_file = undef,
18001800
Optional[String] $modsec_audit_log_pipe = undef,
1801-
Variant[Array[Hash], String] $error_documents = [],
1801+
Array[Apache::Errordocument] $error_documents = [],
18021802
Optional[Variant[Stdlib::Absolutepath, Enum['disabled']]] $fallbackresource = undef,
18031803
Optional[String] $scriptalias = undef,
18041804
Optional[Integer] $limitreqfieldsize = undef,

spec/defines/vhost_spec.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,12 @@
340340
'error_log_file' => 'httpd_error_log',
341341
'error_log_syslog' => true,
342342
'error_log_format' => ['[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i'],
343-
'error_documents' => 'true',
343+
'error_documents' => [
344+
{
345+
'error_code' => '500',
346+
'document' => '/server-error.html',
347+
},
348+
],
344349
'fallbackresource' => '/index.php',
345350
'scriptalias' => '/usr/lib/cgi-bin',
346351
'limitreqfieldsize' => 8190,

types/errordocument.pp

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# @summary A mapping for an error code and a document
2+
type Apache::Errordocument = Struct[
3+
error_code => Variant[String[3, 3], Integer[400, 599]],
4+
document => String[1],
5+
]

0 commit comments

Comments
 (0)