Templating formats in Puppet – EPP and ERB
Templating in Puppet allows for the generation of content in a standard format, by substituting variables and using conditional logic to customize the content. Puppet supports two templating formats: ERB, which is a native Ruby templating format (https://github.com/ruby/erb) and has been available in all versions of Puppet; and EPP templates, which are based on the Puppet language, were introduced in Puppet 4, and are available in later versions of Puppet 3 with the future parser enabled.
Templates provide greater flexibility than strings but are less flexible than using resources such as file_line
, augueas
, or concat
for controlling individual or groups of settings. Therefore, a balance of complexity needs to be struck when deciding whether to use templates or resources.
For relatively short heredoc
files or simple strings, templates with variable interpolation may be sufficient. However, for more complex files and particular...