EPP templates are the replacement for ERB templates, which will be deprecated in a future release of Puppet. EPP templates use the Puppet syntax and are not compiled through Ruby. Two new functions are defined to call EPP templates: epp
and inline_epp
. These functions are the EPP equivalents of the ERB template
and inline_template
functions, respectively. The main difference from EPP templates is that variables are referenced using the Puppet notation, $variable
, instead of @variable
. All variables are fully scoped in EPP templates; there is no need to use the scope function as with ERB templates.
We'll create an EPP template and use puppet apply
to compile the template:
- Create an EPP template in
epp-test.epp
with the following content:
This is <%= $message %>.
- Create an
epp.pp
manifest, which uses theepp
andinline_epp
functions:
$message = "the message" file {'/tmp/epp-test': content => epp('/home/thomas/puppet/epp-test.epp') } notify {"message...