Getting Started Guide

Previously: Next Steps

Frequently Asked Questions

The defaults are way too small or missing something, how do I change the default Vagrant machine?

Sometimes you'd like to add another NIC to your vm, or bump up the memory. You might have a forwarded_port you'd like to add also. The following snippet is a couple suggestions how. You can even turn on the auto_correct if you think you'll need it.

  name: vagrant
  network:
    - ["forwarded_port", {guest: 80, host: 8080, auto_correct: true}]
    - ["forwarded_port", {guest: 443, host: 8443}]
    - ["private_network", {ip: "10.0.0.1"}]
  customize:
    cpus: 2
    memory: 4096

As you can see this very close to the Vagrantfile forwarded_port and works exactly like how you'd expect it to.

Doubly, as you can see the Vagrantfile private_network looks just like you'd expect it to.

If you would like more information the kitchen-vagrant github page has more.

How do I add another driver other than Vagrant?

First, you need to make sure that the driver might already exist, if it does:

~$ gem install kitchen-openstack # for instance
~$ vi cookbooks/demo/.kitchen.yml # wherever your .kitchen.yml is for your cookbook

Read the examples in, for instance, kitchen-openstack or kitchen-digitalocean and edit your .kitchen.yml.

It's suggested after doing this, to run kitchen list to verify that everything is setup and working as suspected. There is a strong chance that the flavors, or image names are different per driver, so you'll need to do the legwork to confirm.

When would I want to use .kitchen.local.yml or .kitchen.cloud.yml?

A .kitchen.local.yml or .kitchen.cloud.yml is an override for the .kitchen.yml in the directory already.

.kitchen.local.ymls are useful for instances where you want to have a "standard" override on your laptop to talk to your cloud/system of choice.

.kitchen.cloud.ymls are useful for a shared cloud based .kitchen.yml for everyone, for instance the rabbitmq has one for verifying on Digital Ocean. With a simple bash alias, you can change and verify that it works as expected:

bash ~$ alias cloud_testing='export KITCHEN_YAML=.kitchen.cloud.yml && chef exec kitchen list'

This is per setup of course, but you should get the point here.

How do I update just test-kitchen if I'm using Chef-DK?

To take from discourse.chef.io, you can

bash chef gem install appbundle-updater appbundle-updater chefdk test-kitchen v1.6.0 # or whatever version you want update to

The appbundle-updater gem can update a "appbundled" gem in a chef or chefdk omnibus install and reference a specific git branch, tag or sha. The above uses it to pull down the v1.6.0 tag of the test-kitchen repo and then propperly pins that inside an existing chefdk installation.

How do I change the user to access the instance?

You can edit the .kitchen.yml with a transport option, for instance:

yaml transport: username: ubuntu