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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access