Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cookbook synchronization with chef-client?

I would like to test/debug cookbooks. However, using chef-client to restart a chef run, this requires me to modify cookbooks, upload them to the chef server & synchronize cookbooks. I would like to be able to modify the cookbooks that were synchronized and stored in the cache, instead of having to upload every single little change I make at each iteration. Is this possible?

Thanks

tl;dr in chef-client, how to use the cached cookbooks instead of synchronizing them every time

like image 652
eloaf Avatar asked Mar 24 '15 19:03

eloaf


Video Answer


2 Answers

chef-client --skip-cookbook-sync

Use cached cookbooks without overwriting local differences from the server. Use with caution. Useful for patching a set of cookbooks on a machine when iterating during development. New in Chef Client 12.8.1.

https://docs.chef.io/ctl_chef_client.html

like image 84
mcoolive Avatar answered Oct 02 '22 12:10

mcoolive


For Chef prior version 12 command is chef-solo -z -o <cookbook_name>

like image 33
a.moiseyenko Avatar answered Oct 02 '22 13:10

a.moiseyenko