Chapter 9. Managing files with templates

 

Simplicity does not precede complexity, but follows it.

 
 --Alan Perlis

In this chapter, we'll learn about an important and powerful feature of Puppet: the template. We'll see how to use a simple template to interpolate the values of Puppet variables, facts, and Hiera data into a file, and we'll also introduce more complex templates using iteration and conditional statements to generate dynamic configuration files.

Managing files with templates

What are templates?

In previous chapters, we've used Puppet to manage the contents of files on the node by various means, including setting the contents to a literal string using the content attribute, ...

Get Puppet 5 Beginner's Guide - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.