Chapter 3. Chef and Ruby

When we say that we will be specifying our infrastructure as a code using Chef, what we mean is that we'll be writing code using domain-specific language (DSL) provided by Chef. This code will be executed by chef-client on the concerned machine, and the machine will be bootstrapped as per the guidelines we specify in our code. The DSL provided by Chef is very much like Rake tasks, and Ruby developers will find themselves at home when writing Chef code.

Chef DSL is actually a Ruby DSL, and one can use the full power of Ruby as a programming language when trying to write Chef code. The term "Chef code" is used loosely here, to specify recipes, roles, environments, templates, resources, attributes, libraries, and so on.

Chef ...

Get Mastering Chef now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.