O'Reilly logo

Configuration Management with Chef-Solo by Naveed ur Rahman

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

Exploring templates

A template is an Embedded Ruby (ERB) file that is used to create configuration files based on variables and logic defined by a cookbook. A template can contain mixed Ruby code or expressions; it provides a great way to manage configuration files on any node.

Templates are used with a template resource, and each resource includes actions, attributes, and file sources. Template resources are very close to file resources; the only difference is that templates are based on Ruby code, and on the other hand, file resources are used to copy files to a particular location.

Templates should have the following two components:

  • A template resource, which instructs the chef-client to perform any action
  • A template file in the templates folder ...

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