Last active
February 12, 2019 06:06
-
-
Save binford2k/9adf86c70b4075fc1668048bcb3f113c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# <module>/functions/deferred_epp.pp | |
# note: depends on puppetlabs/stdlib | |
function deferred_epp(String $template, Hash $variables) >> Deferred { | |
if($template[0] == '/') { | |
$path = $template | |
} | |
else { | |
$parts = $template.split('/') | |
$mod = get_module_path($parts[0]) | |
$file = $parts[1,-1].join('/') | |
$path = "${mod}/templates/${file}" | |
} | |
Deferred("inline_epp", [file($path), $variables]) | |
} |
Author
binford2k
commented
Feb 12, 2019
We should add find_template()
function analog to find_file()
in puppet. (The underlying implementation in Puppet::Pops::Parser::Files
already supports finding template in the method find_template(template, environment)
)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment