Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find_template breaks the implied functionality of deferrable_epp #9518

Open
tedgarb opened this issue Nov 11, 2024 · 0 comments
Open

find_template breaks the implied functionality of deferrable_epp #9518

tedgarb opened this issue Nov 11, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tedgarb
Copy link

tedgarb commented Nov 11, 2024

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

  1. 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)
    }
  1. 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

@tedgarb tedgarb added the bug Something isn't working label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant