Cookbooks: Multiple Recipes can be grouped to form a Cookbook. A Cookbook defines a scenario and contains everything that is required to support that scenario:
Recipes specify the resources to use and the order in which they are to be applied
* Attribute values
*Extensions to Chef, such as custom resources and libraries
Now we will create our first Cookbook.
Create a directory called cookbooks, and execute the below command to generate the Cookbook.
#chef generate cookbook httpd_deploy
Generating cookbook httpd_deploy
- Ensuring correct cookbook file content
- Ensuring delivery configuration
- Ensuring correct delivery build cookbook content
Your cookbook is ready. Type `cd httpd_deploy` to enter it.
There are several commands you can run to get started locally developing and testing your cookbook.
Type `delivery local --help` to see a full list.
Why not start by writing a test? Tests for the default recipe are stored at:
If you'd prefer to dive right in, the default recipe can be found at:
httpd_deploy is a name given to the Cookbook. You can give any name that you want and Let's move to this new directory httpd_deploy.
Now let us see the file structure of the created Cookbook
│ └── default.rb
│ ├── spec_helper.rb
│ └── unit
│ └── recipes
│ └── default_spec.rb
Testing cookbook with Test kitchen
Leave a Comment
We will be happy to hear what you think about this post