The Puppet templates

Templates are used to specify the contents of files. When we have a file to be created and its content needs to be created dynamically, we use templates. Templates are written in the ERB templating language. ERB is supported by Ruby. You can refer to for more information. To use a template, we need to create a folder named templates under the relevant module. In the templates folder, we can use any file name with the .erb extension.

We will start with a simple file creation example. As you will remember, our first module was the helloworld module and we created a file in the hosts from static content. Now let's go back to this and add some dynamic content.

To refresh ...

Get Learning Puppet for Windows Server now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.