How to specify cookbook path in .kitchen.yml file for chef_solo provisioner?

吃可爱长大的小学妹 提交于 2019-12-06 01:48:28

I can't speak for it's place in the yaml. However I was able to get it working using a line in the knife.rb

Sounds right to me, but remember that config.rb takes precedence now, since Chef Client 12.0.

The docs do well to describe this, but keep in mind the attributes that the others have described:

Default config.rb Location:

~/.chef/config.rb

cookbook path syntax:

cookbook_path ["/full/path/to/repo/cookbooks"]

And reload Chef to test.

It should be an array in Yaml:

provisioner:
  name: chef_solo
  require_chef_omnibus: 11.8.0
  roles_path: '../../roles'
  data_bags_path: '../../data_bags'
  environments_path: '../../environments'
  cookbooks_path:
    - ../cookbooks
    - ../../site-cookbooks

I can't speak for it's place in the yaml. However I was able to get it working using a line in the knife.rb

cookbook_path ["/full/path/to/repo/cookbooks"]

using this in the knife.rb of the repo where I was running kitchen allowed it to work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!