forked from le0pard/chef_book
-
Notifications
You must be signed in to change notification settings - Fork 0
/
writing_cookbooks.tex
22 lines (16 loc) · 1.48 KB
/
writing_cookbooks.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
\chapter{Writing Cookbooks}
A cookbook is the fundamental unit of configuration and policy distribution. Each cookbook defines a scenario, such as everything needed to install and configure MySQL, and then it contains all of the components that are required to support that scenario.
As you read from previous chapter vendor cookbooks can help you to install and configure any possible software, but in most cases it is not enough. This is because you have your application, which need install, configure special cases only for this application. What is why you must to know how to write own Chef cookbooks.
Chef cookbooks is written on \href{https://www.ruby-lang.org}{Ruby} language. It is dynamic and open source programming language, which very well fit to use as \href{http://en.wikipedia.org/wiki/Domain-specific\_language}{DSL} for Chef recipes. Before you start reading this chapter, you should know Ruby at least basic stuff (Ruby types, loops, conditions, ERB, etc).
\input{writing_cookbooks/file_organization}
\input{writing_cookbooks/metadata}
\input{writing_cookbooks/resources}
\input{writing_cookbooks/recipes}
\input{writing_cookbooks/attributes}
\input{writing_cookbooks/templates}
\input{writing_cookbooks/lwrp}
\input{writing_cookbooks/hwrp}
\input{writing_cookbooks/definitions}
\input{writing_cookbooks/ohai}
\section{Summary}
A cookbook is the fundamental unit of configuration and policy distribution. Knowledge of how to write cookbooks is very important to fully use all power of Chef.