O'Reilly logo

Learning Puppet for Windows Server by Fuat Ulugay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 http://ruby-doc.org/stdlib-1.8.7/libdoc/erb/rdoc/ERB.html 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required