O'Reilly logo

Mastering Chef by Mayank Joshi

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

Templates

As we mentioned earlier, templates are Embedded Ruby (ERB) templates, which can be used to generate configuration files based upon some variables and logic. These files may contain Ruby statements and expressions. To make use of templates, one has to use the template resource in a cookbook and specify in the source the path to the template itself. The template file is placed in the templates directory of a cookbook.

Unless you are creating your cookbooks manually, Knife will automatically take care of creating the templates directory structure. A template is stored in the cookbook_name/templates directory and is referenced by the template resource in the cookbook recipe. Generally, cookbooks are developed, keeping different platforms ...

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