Skip to content

Commit ce29022

Browse files
smortexRamesh7
authored andcommitted
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 e3320a5 commit ce29022

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

manifests/mod/php.pp

Lines changed: 4 additions & 1 deletion
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)