将食谱名称包含在厨师中时对其进行澄清

clarification on recipe names when including them in chef

我在使用 include_recipe 时需要一些说明。

首先我的假设是否正确

include_recipe "cookbook-name::recipe"

无效,因为 -,它应该是 _

第二 cookbook-name 生成或设置的确切位置,以便我可以更改它。

我看过了,但我在 google 中找不到答案,事实是我有点累(所以我没有全力以赴)所以我有一点想不出一些简单问题的答案。

首先,你的假设是不正确的。 可以使用 - 的食谱名称,例如 cookbook-name.

食谱名称在 metadata.rb 文件中定义。

apt食谱为例(https://github.com/opscode-cookbooks/apt), the cookbook name is defined here: https://github.com/opscode-cookbooks/apt/blob/master/metadata.rb#L1