Created
December 2, 2016 18:06
-
-
Save hlindberg/b4aa1694350534f7d991fed912f9c076 to your computer and use it in GitHub Desktop.
An example of using a local variable in EPP
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
# Example of local variables set inside of an EPP template | |
# | |
$template = @(EOF) | |
<% | |
# this is an element with arbitrary puppet code | |
$hash = { a => 1, b => 2, c => 3 } | |
-%> | |
The keys are: | |
<%- $hash.each |$key, $value| { -%> | |
<%= $key %> | |
<%- } -%> | |
The values are: | |
<%- $hash.each |$key, $value| { -%> | |
<%= $value %> | |
<%- } -%> | |
So long, and thanks for all the fish. | |
EOF | |
notice inline_epp($template) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Outputs: