EPP structure and syntax
An EPP template looks like a plain-text document interspersed with tags containing Puppet expressions. When evaluated, these tagged expressions can modify text in the template. You can use Puppet variables in an EPP template to customize its output.
The following example shows parameter tags (<% |
), non-printing
expression tags (<%
), expression-printing tags (<%=
), and comment tags (<%#
). A hyphen in
a tag (-
) strips
leading or trailing whitespace when printing the evaluated
template:
<%- | Boolean $keys_enable, String $keys_file, Array $keys_trusted, String $keys_requestkey, String $keys_controlkey | -%> <% if $keys_enable { -%> <%# Printing the keys file, trusted key, request key, and control key: -%> keys <%= $keys_file %> <% unless $keys_trusted =~ Array[Data,0,0] { -%> trustedkey <%= $keys_trusted.join(' ') %> <% } -%> <% if $keys_requestkey =~ String[1] { -%> requestkey <%= $keys_requestkey %> <% } -%> <% if $keys_controlkey =~ String[1] { -%> controlkey <%= $keys_controlkey %> <% } -%> <% } -%>