InterviewSolution
Saved Bookmarks
| 1. |
What are libraries in Chef? When we use them? |
|
Answer» Libraries store arbitrary Ruby code that could be reused ACROSS the recipes within any cookbook that depends on the library. This is often located in the library folder of our cookbooks. First and the foremost usage of libraries are to provide helper methods that reduce the code duplication and also provide a mechanism to hide the implementation logic in the recipes. Libraries get loaded first when the Chef LOADS our cookbooks.It make use of “ load_libraries_from_cookbook” method from the “Chef::RunContext::CookbookCompiler” class. Typical use cases of libraries are
|
|