0
votes

I want to test my cookbooks on different environments using Vagrant.

As I've found, there are chef-client and chef-solo provisioners, used to respectively download cookbooks from chef-server and to serve cookbooks locally.

I want to provide Vagrantifle inside each cookbook in order to provide way to test it for all knife developers. If cookbook was standalone, I'd just use chef-solo provisioner, but what if it has (multiple) dependencies of cookbooks stored on chef-server?

What's the best idea to resolve this problem:

  1. Download all cookbooks locally and copy it to Vagrant
  2. Push only tested cookbook and download rest of them from chef-server

What are advantages and disadvantages? How should I test my cookbooks on different systems?

1
I feel like Test-Kitchen exists to make this easy.Matt Schuchard

1 Answers

2
votes

This is indeed what Test Kitchen is for. It has a driver for Vagrant, or you can use almost any other VM/cloud system imaginable via another driver plugin. It integrates with Berkshelf and the Policyfile system to handle dependency management, so you would use one of those (which hopefully you already are).