erb - How to include a subtemplate in a Puppet template -
i'm trying include subtemplate in template 1 of puppet modules. here's how include in base template:
<% def import(fname) erb = file.open(file.dirname(__file__) + "/" + fname) { |fp| erb.new(fp.read) } erb.run end %> <%= import("subtemplate.erb") %>
this works fine if render erb command-line tool. however, during puppet run import silently ignored, i.e. base template rendered blank line rendered subtemplate should be. there no errors generated.
what doing wrong? thanks!
how about:
<%= scope.function_template("subtemplate.erb") %>
Comments
Post a Comment