Ronald
Ronald

Reputation: 2932

Using cookbook version in chef local mode

My understanding is that when using Chef client in local mode a cookbook can only have one version - the one currently specified in the cookbook's metadata.rb file. For example when I have a cookbook "my-cookbook" and it's metadata.rb file contains:

version          '0.5.0'

then I can run

sudo chef-client -z -o [email protected] 

but I will not be able to run a previous version of this cookbook in local mode.

Is this correct?

Are there any alternatives to work with different versions of a cookbook in local mode?

Upvotes: 1

Views: 798

Answers (1)

coderanger
coderanger

Reputation: 54249

If you are using solo or client in local mode you can use Berkshelf or Librarian to handle the version solving and download a flattened set of cookbooks that match the solution. In Berkshelf you would use berks vendor $PATH for this. Once you have the vendored cookbook folder, pass that in to solo/client.

Upvotes: 1

Related Questions