Created
November 6, 2014 15:49
-
-
Save tzz/d2a44f3afcfb30a74fdb 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
body common control | |
{ | |
inputs => { "$(sys.libdir)/stdlib.cf" }; | |
bundlesequence => { "run", "write" }; | |
} | |
bundle agent run | |
{ | |
vars: | |
"var_slist" slist => { | |
"line1", | |
"line2 with space", | |
"line3", | |
"line4" }; | |
"var_string" string => "teststring"; | |
methods: | |
# make the Mustache template (usually you'd maintain it separately) | |
"" usebundle => file_make("$(this.promise_filename).mustache", | |
"slist = {{#vars.run.var_slist}}element = {{.}}, {{/vars.run.var_slist}} | |
string = {{vars.run.var_string}}"); | |
} | |
bundle agent write | |
{ | |
files: | |
"/tmp/output.txt" | |
create => "true", | |
edit_template => "$(this.promise_filename).mustache", | |
# note that without a template_data, we use the datastate() function! | |
# template_data => readjson($(json_file), "100k"), | |
template_method => "mustache"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment