Skip to content

Instantly share code, notes, and snippets.

@fnichol fnichol/
Last active Jan 20, 2019

What would you like to do?
(Excellent?) Format Changes to Test Kitchen's kitchen.yml

Format Changes to Test Kitchen's kitchen.yml File

This is happening thanks to a refactoring of the data manipulation code formerly in Kitchen::Config.

There are now 3 main configuration blocks that can be placed in the various levels:

  • driver: Configurtation relavent to Kitchen drivers. This is a combination of what was driver_plugin and driver_config. Backwards compatability is guarenteed with the legacy formats for a time, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • provisioner: Configuration relating to the automation tool being used. Currently supporting "chef_solo" and "chef_zero". Previously several Chef-related config paths were dumped in a Suite block, namely data_path, data_bags_path, environments_path, nodes_path, roles_path, etc. These will be supported for backwards compatability, then will be deprecated (with a warning when encountered), then will be removed in a future release.
  • busser: Configuration relating to the Busser gem such as version to install, alternative path to Ruby, and coming soon runner plugin version support. The busser block is net new but will be very helpful when developing Busser runner plugins or pinning versions the components.

There remain 3 places to put the above configuration blocks:

  • In a particular Suite block
  • In a particular Platform block
  • In the root of the YAML document, which is also known as the common location

The precedence order for recursive merging is as follows (from highest to lowest):

  1. Suite
  2. Platform
  3. Common
driver: docker
name: chef_zero
require_chef_omnibus: 11.6.2
roles_path: /tmp/somewhere/else/local
encrypted_data_bag_secret_key_path: /alternative/secret_key
node_name: biscuit
version: 0.9.0.rc2
root_path: /var/tmp/kitchen-busser-yo
ruby_bindir: /opt/local/bin
- name: ubuntu-12.04
- name: ubuntu-13.04
image: ubuntu:13.04
provisioner: chef_solo
busser: busser-alternative@0.1.0
- name: server
- name: client
memory: 128

This comment has been minimized.

Copy link

commented Feb 19, 2014

You're using two different provisioners here in kitchen.yml: chef_zero(in provisioner) and chef_solo(in platforms).
Could you explain which one will be chosen?


This comment has been minimized.

Copy link

commented Mar 2, 2014

@iroller mainly to test my own understanding of this. I think: chef_solo will be used for ubuntu-13.04 and chef_zero will be used for ubuntu-12.04. This is because chef_solo isn't scoped to platforms but to the second list item in platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.