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]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We should add
find_template()
function analog tofind_file()
in puppet. (The underlying implementation inPuppet::Pops::Parser::Files
already supports finding template in the methodfind_template(template, environment)
)