Skip to content

Commit 675fb82

Browse files
committed
Make sure we still support ERB templates when provided
`apache::mod::php` allows to pass an ERB template, switching the default template to EPP will require us to change the default value of the `template` parameter which is generally a breaking change. Users who rely on this parameter to provide a custom template are currently using an ERB template, so we must preserve the legacy behavior for them, and detect if the template should be processed as ERB or EPP. For this purpose, we check the file extension in a conservative way (any template whose filename does not end with `.epp` is assumbed to be an ERB template). As a result, this change is backwards-compatible for end-users.
1 parent cc66b93 commit 675fb82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: manifests/mod/php.pp

+4-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@
7171

7272
$manage_content = $source ? {
7373
undef => $content ? {
74-
undef => template($template),
74+
undef => $template ? {
75+
/\.epp\z/ => epp($template, { 'extensions' => $extensions }),
76+
default => template($template),
77+
},
7578
default => $content,
7679
},
7780
default => undef,

0 commit comments

Comments
 (0)