问题描述
我的厨师食谱存储在Chef / cookbooks /文件夹中。在运行厨房会聚
时,我仍会收到通知
I have my Chef cookbooks stored in chef/cookbooks/ folder. When running kitchen converge
I am still getting notice
Berksfile, Cheffile, cookbooks/, or metadata.rb not found so Chef will run with effectively no cookbooks. Is this intended?
我尝试了很多选择,例如:
I tried many options, for example:
suites:
- name: default
run_list: recipe[git]
cookbook_path: "chef/cookbooks"
但我找不到合适的解决方案。如何指定食谱和角色的路径?
but I can't find the proper solution. How to specify the cookbooks' and roles' paths?
推荐答案
您需要将路径放入berks文件中,
You'll want to put the path in your berksfile, which will likely end up looking like so..
source 'https://supermarket.chef.io'
cookbook 'cookbookname', path: 'relative/or/absolute/path/to/cookbook/directory'
厨师在部署代码时也会使用berksfile,因此如果您的相对文件结构与厨师服务器上的机器上的相对文件结构相同(即所有食谱共享一个目录,以便您的berksfile可以使用路径'../ cookbookname')
The berksfile is also used by chef when you deploy your code so it helps if your relative file structure is the same on your machine as it is on your chef server (i.e. all cookbooks share a directory so your berksfile can use the path '../cookbookname')
这篇关于如何在.kitchen.yml文件中指定食谱路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!