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 ...