Last active
June 3, 2020 18:08
-
-
Save binford2k/73e81e9179d87d56af15f081d6c3259e to your computer and use it in GitHub Desktop.
This file contains 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
# A quick and untested implementation of a deferred_epp() function to abstract | |
# the fiddly bits for deferring a template and render it agent side. | |
# | |
# Note: This depends on my find_template() PR. | |
# | |
# Note: If you're resolving variables agent side, then you'll have to defer | |
# them as well. Pass them in via the $variables hash like this example: | |
# | |
# $variables = { | |
# 'password' => Deferred('vault_lookup::lookup', | |
# ["secret/test", 'https://vault.docker:8200']), | |
# } | |
# file { '/etc/secrets.conf': | |
# ensure => file, | |
# content => deferred_epp('mymod/secret.conf.epp', $variables), | |
# } | |
# | |
function stdlib::deferred_epp(String $path, Hash $variables) >> Deferred { | |
Deferred('inline_epp', | |
[find_template($path).file, $variables]), | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment