Chef 简明教程
Chef - Cookbook Dependencies
定义 Cookbook 依赖项的功能有助于管理 Cookbook。当我们在其他 Cookbook 中想要使用一个 Cookbook 的功能时,就会使用该功能。
The features of defining cookbook dependencies help in managing cookbook. This feature is used when we want to use the functionality of one cookbook in other cookbooks.
例如,如果想要编译 C 代码,则需要确保安装了编译所需的全部依赖项。要进行编译,可能会有能够执行这种功能的独立 Cookbook。
For example, if one wants to compile C code then one needs to make sure that all the dependencies required to compile are installed. In order to do so, there might be separate cookbook which can perform such a function.
当我们在使用 Chef 服务器时,需要了解 Cookbook 中的这些依赖项,应在 Cookbook 元数据文件中对此进行延迟处理。此文件位于 Cookbook 目录结构的顶部。它会提供提示给 Chef 服务器,该服务器有助于在正确的节点上部署 Cookbook。
When we are using chef-server, we need to know such dependencies in cookbooks which should be decelerated in the cookbooks metadata file. This file is located at the top on the cookbook directory structure. It provides hints to the Chef server which helps in deploying cookbooks on the correct node.