It sounds like you're wanting to apply Bento, Vagrant, and/or Veewee to provision & perform QA testing on boxes. Thanks to the folks & community behind Chef, a tool already exists to do exactly what you are trying to do!
It's called test-kitchen
. You can use it with the prebuilt Chef Bento Boxes which OpsCode/Chef maintains and builds with Packer. No need to build Vagrant boxes or VM images from scratch with VeeWee or Packer if you just want to get to Provisioning / Testing.
Test Kitchen is a test harness tool to execute provisioning code (in Chef, Ansible, Puppet, SaltStack, or Bash / Powershell via bootstrap.sh
or bootstrap.ps1
) on one or more platforms in isolation. It uses a driver plugin architecture which lets you plug it into various cloud providers and virtualization technologies such as Amazon EC2, Blue Box, CloudStack, Digital Ocean, Rackspace, OpenStack, Vagrant, Docker, LXC containers, VMWare VSphere, Google Compute Engine, Azure, and many more. There are also "busser" testing plugins which allow pluggable support for multiple testing frameworks including Bats, shUnit2, RSpec, Serverspec, Shpec, Tox, Nose2, MiniTest, Cucumber, AnsibleSpec, with others being created.
For Chef, Puppet, and Ansible workflows, cookbook dependency resolver tools such as Berkshelf, Librarian-Chef, Librarian-Puppet, Ansible Galaxy, Librarian-Ansible are supported or you can simply have a cookbooks/
directory and Test Kitchen will know what to do. If you are already using Chef community cookbooks, Test Kitchen integration tests are already included in many such as the MySQL, nginx, Chef Server, and runit cookbooks.
It's pretty flexible and for your use case, you can probably make it do what you want by choosing the right set of gem plugins. Because it came out of the Chef community, you'll probably have the best experience using it with Chef cookbooks, Vagrant driver, and either ServerSpec or Bats testing plugins. However, it is gaining traction as a CI & QA testing tool on it's own with the many community plugins that are available.
If you're interested in seeing what's out there, just search RubyGems for kitchen-
or busser-
for more options.
If you're new to Ruby, Chef, or all of this in general... an easy way to get started is to install the ChefDK which includes test-kitchen
, knife
, Berkshelf
and the basic / Chef.io-supported testing tools.
Once you have that, and if you're feeling adventurous or want to experiment with alternative pluggable provisioners, drivers, and busser plugins, you can install any of these into the ChefDK Ruby environment (example for Mac OS X / Unix) by using these commands:
$(/opt/chefdk/bin/chef shell-init $(basename $SHELL))
sudo /opt/chefdk/embedded/bin/gem install $kitchen_plugin_gem_name_here
If you want to play around with a demo repository that I've created for testing Ansible playbooks / roles, check out Ansible TDD