Description
Describe the Bug
I am trying to use stdlib::deferrable_epp
, from functions/deferrable_epp.pp . In the case a Deferred value appears, find_template
from lib/puppet/functions/find_template.rb is used to find the template. However, find_template
requires the .epp
extension to be defined, while stdlib::deferrable_epp
does not provide it, so the template cannot be found when leaving off the .epp
in both the case where there is a Deferred, and when there is not.
Expected Behavior
Regardless of the presence or lack of a Deferred, stdlib::deferrable_epp
should render the epp template without the .epp
extension.
Steps to Reproduce
I will borrow the example from https://www.puppet.com/docs/puppet/8/template_with_deferred_values.html
- Define this collection of resources:
$variables = {
'password' => 'foo',
}
# compile the template source into the catalog
file { '/etc/secrets.conf':
ensure => file,
content => epp('mymodule/secrets.conf', $variables)
}
$variables = {
'password' => Deferred('vault_lookup::lookup',
["secret/test", 'https://vault.docker:8200']),
}
# compile the template source into the catalog
file { '/etc/secrets.conf':
ensure => file,
content => stdlib::deferrable_epp('mymodule/secrets.conf', $variables)
}
- The first declaration works, but the second cannot find the template
Environment
- Version 7.26.0
- Platform RHEL8
Additional Context
This can be worked around if you always include the .epp
extension, but since it isn't required in the epp
function, it would be nice if it was not required in thedeferrable_epp
function