Chef – Libraries
Libraries in Chef provides a place to encapsulate compiled logic so that the cookbook recipes remain neat and clean. Creating the Library Step1 − Create a helper method in cookbook’s library.…
Libraries in Chef provides a place to encapsulate compiled logic so that the cookbook recipes remain neat and clean. Creating the Library Step1 − Create a helper method in cookbook’s library.…
Recipes are the key building blocks of cookbook which is basically Ruby code. It is possible to use all of the Ruby language features inside the Chef recipe. Most of…
In Chef, if one needs to create simple recipes one can use resources available in Chef, such as templates, remote_file, and services. However as the recipes become elaborate, one needs…
In Infrastructure, configuration management is all about how well one configures the hosts. In general, all the configurations are done using the configuration files. Chef uses templates to be able to fill…
Attributes are the key components for dynamically configuring cookbooks. Attributes enable the authors to make the cookbook configurable. By overriding default values set in cookbooks, the user can inject their…
In order to test Chef-Client run, we need to have Chef-Client configured to use the hosted Chef or own hosted server. Running Chef-Client in Debug Mode vipin@server:~$ sudo chef-client -l…
Knife preflight shows details about all the nodes which uses a certain cookbook before uploading it to Chef server. Getting Started In order to get started, we need to have knife-preflight…
Test kitchen is Chef’s integration testing framework. It enables writing tests, which run after VM is instantiated and converged using the cookbook. The tests run on VM and can verify…
Test Driven Development (TDD) is a way to write unit test before writing any actual recipe code. The test should be real and should validate what a recipe does. It should…
Writing good cookbooks without any issue is quite a difficult task. But there are ways which can help in identifying the pitfalls. Flagging in Chef Cookbook is possible. Foodcritic is…