Preventing the deletion of cache when running chef-client -o

Hi Chefs.

When I do a chef-client -o just_one_cookbook it removes all the other cookbooks from the cache because they are “no longer needed on this client”. Then next time a scheduled run occurs all the cookbooks get downloaded again. For various reasons I’d rather this didn’t happen.

I tried putting this in the client.rb file:

cache_options({ :skip_expires => true})

But it does not affect this behavior.

Can anyone point me to a way of preventing this cache cleanup when using an run_list override?

Thanks!

try Chef::Config[:file_cache_path] to something other than the default one.
I have used this trick to orchestrate multi-stage chef runs ,
you can see some example here:

if you want this to be done via command line, you might want to run the
chef-client -o just_one_cookbook -c

regards
ranjib

On Wed, Apr 3, 2013 at 1:04 PM, Chris Sibbitt
csibbitt@thinkingphones.comwrote:

Hi Chefs. ****


When I do a chef-client –o just_one_cookbook it removes all the other
cookbooks from the cache because they are “no longer needed on this
client”. Then next time a scheduled run occurs all the cookbooks get
downloaded again. For various reasons I’d rather this didn’t happen.****


I tried putting this in the client.rb file:****


cache_options({ :skip_expires => true})****


But it does not affect this behavior.****


Can anyone point me to a way of preventing this cache cleanup when using
an run_list override?****


Thanks!****