download roles and cookbooks from ChefServer with knife

倖福魔咒の 提交于 2019-12-03 14:08:26

You can use the knife environment list and knife environment show commands to download environments and replace "environment" with "role" to do the same for roles.

mkdir environments
for env in `knife environment list`; do
  knife environment show $env --format=json > environments/$env.json
done

You can then check these JSON files into git and edit/upload with knife.

You mentioned cookbooks in your title, but not your post.

if you want to download cookbooks, knife cookbook download NAME works. Put it in a for loop like Tim Potter did and you get all your cookbooks.

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