You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 14, 2022. It is now read-only.
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. That is why you must 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 fits 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.