5 Jan 2012 skvidal   » (Master)

puppet template ‘heredoc’

Using puppet? So sad.

Need to use puppet templates? Even worse.

Have to include a file, verbatim inside the resulting file but you don’t want to put it in your template itself b/c it is too big or cumbersome? Here’s how you do it.

 

1. put the file in the ‘files’ subdir in the module you’re working on in puppet

2. put this in your template

<%=
fn = Puppet::Module.find("test").file_directory + "/myfile.txt"
File.read(fn)
-%>

then that file will be read from the ‘files’ dir in your module directly into the output from the template.


Syndicated 2012-01-05 02:47:55 from journal/notes

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!