There are a few basic ways of dynamically configuring Kitchen:
To specify a path to a global config.yml , project or local kitchen.yml file, set the following environment variables:
export KITCHEN_GLOBAL_YAML=/path/to/your/global/config.yml export KITCHEN_YAML=/path/to/your/project/kitchen.yml export KITCHEN_LOCAL_YAML=/path/to/your/local/kitchen.local.yml
Note: If $HOME/.kitchen/config.yml is present, kitchen will merge this file with your project’s kitchen.yml , and/or kitchen.local.yml file. Merge precedence is:
For example, one could modify kitchen.yml (or kitchen.local.yml , or $HOME/.kitchen/config.yml ) to look like:
--- driver: name: openstack openstack_username: openstack_api_key: openstack_auth_url: image_ref: flavor_ref:
Keep in mind, this assumes you have an OpenStack deployment setup and ready to use. This is only an example so to illustrate using environment variables via ERB snippets in the configuration file.
Another handy use of the ERB fragments is to dynamically override the log_level of the provisioner. Since Kitchen 1.7.0 the log level for the provisioner is now independent of the Kitchen log level. Using the following snippet, allows the environment to override the provisioner log level without modifying the config file.:
--- provisioner: name: chef_zero log_level: