Omnitruck downloads are being shutdown for specific Chef Infra Client versions and will stop working entirely in the future. This gem is also not compatible with Chef Infra Client 19+ new Habitat-based installation method.
- For Chef customers: Switch to kitchen-chef-enterprise (bundled in Chef Workstation 26.x+) for licensed download support
- For community users: Switch to kitchen-cinc and use Cinc provisioners like
cinc_infra
Please refer to the Chef blog for the schedule of affected versions.
A Test Kitchen provisioner for Chef Infra Client that downloads and installs omnibus packages.
This Test Kitchen plugin provides provisioners that automatically download and install the desired version of Chef Infra Client on your test instances using Chef's omnitruck API or licensed download endpoints. This allows you to test your cookbooks against different Chef versions without pre-installing Chef on your images.
Note: This gem ships as part of Chef Workstation. If you're using Chef Workstation, no additional installation is necessary.
For standalone installation, add this line to your Gemfile:
gem 'kitchen-omnibus-chef'Then execute:
bundle installOr install it directly:
gem install kitchen-omnibus-chefThis gem provides five provisioners:
chef_infra- Modern Chef Infra Client provisioner (recommended)chef_zero- Deprecated alias for chef_infra (maintained for backward compatibility)chef_solo- Chef Solo provisioner (note: does not support parallel converge)chef_apply- Chef Apply provisioner for running individual recipeschef_target- Chef Target Mode provisioner (requires Chef 19.0.0+, Train-based transport)
To use the Chef Infra provisioner in your kitchen.yml:
provisioner:
name: chef_infraHere's a complete kitchen.yml example showing typical usage:
---
driver:
name: vagrant
provisioner:
name: chef_infra
product_name: chef
install_strategy: always
channel: stable
chef_license: accept-no-persist
platforms:
- name: ubuntu-24.04
- name: almalinux-9
suites:
- name: default
run_list:
- recipe[my_cookbook::default]The provisioner supports the following configuration options:
- Type: String
- Default:
nil(falls back to legacy install behavior) - Description: The product to install. Set to
cheffor Chef Infra Client. Required for using licensed downloads.
- Type: String
- Default:
ENV["CHEF_LICENSE_KEY"] - Description: License key for downloading licensed Chef products. Required for licensed downloads.
Example:
provisioner:
name: chef_infra
product_name: chef
chef_license_key: your-license-key-here
version: latest- Type: String/Symbol
- Default:
stable - Common Options:
stable,current - Description: The release channel to install from. Accepts any symbol value.
- Type: String
- Default:
latest - Description: The version of Chef Infra Client to install. Can be a specific version (e.g.,
18.3.0) orlatest.
Example:
provisioner:
name: chef_infra
product_name: chef
version: 18.3.0- Type: String
- Default:
once - Options:
once,always - Description: When to install Chef.
onceonly installs if not present,alwaysreinstalls on every converge.
- Type: String
- Default: none
- Options:
accept,accept-no-persist,accept-silent - Description: Accept the Chef license agreement.
- Type: String
- Default: none
- Description: Override the download URL for custom package locations or air-gapped environments.
- Type: String
- Default: none
- Description: SHA256 checksum to verify the downloaded package. Used with
download_url.
- Type: String
- Default: Auto-detected
- Description: Explicitly specify platform details for package selection.
You can test your cookbook against multiple Chef versions by defining multiple suites:
provisioner:
name: chef_infra
chef_license: accept-no-persist
platforms:
- name: ubuntu-22.04
suites:
- name: chef-17
provisioner:
version: 17.10.0
run_list:
- recipe[my_cookbook::default]
- name: chef-18
provisioner:
version: 18.3.0
run_list:
- recipe[my_cookbook::default]
- name: chef-latest
provisioner:
version: latest
run_list:
- recipe[my_cookbook::default]For air-gapped environments or custom Chef builds:
provisioner:
name: chef_infra
product_name: chef
download_url: https://my-mirror.local/chef-packages/chef_18.3.0-1_amd64.deb
checksum: sha256-checksum-here # optional but recommendedTo test with the latest unstable builds:
provisioner:
name: chef_infra
product_name: chef
channel: current
version: latestUseful for testing installation scripts or ensuring a clean state:
provisioner:
name: chef_infra
product_name: chef
install_strategy: alwaysImportant: ChefSolo does not support parallel converge due to Berkshelf not being thread-safe. Test Kitchen will run ChefSolo converges sequentially.
provisioner:
name: chef_solo
product_name: chef
chef_license: accept-no-persistChef Apply runs individual recipes without a full Chef run. Place your recipes in an apply/ directory:
provisioner:
name: chef_apply
product_name: chef
suites:
- name: default
run_list:
- recipe1 # runs apply/recipe1.rb
- recipe2 # runs apply/recipe2.rbChef Target Mode requires:
- Chef Infra Client 19.0.0 or later
- A Train-based transport (e.g.,
kitchen-transport-train)
driver:
name: vagrant
transport:
name: train # Required for chef_target
provisioner:
name: chef_target
product_name: chef
product_version: "19.0.0"
chef_license: accept-no-persistNote: Chef Target Mode has a default install_strategy of "none" since Chef runs from your local workstation.
Chef Zero is deprecated and maintained only for backward compatibility. It's an alias for ChefInfra. Use chef_infra instead:
# Deprecated
provisioner:
name: chef_zero
# Use this instead
provisioner:
name: chef_infrakitchen-omnibus-chef automatically detects and defers to enterprise provisioner implementations when available. If you have kitchen-chef-enterprise or kitchen-cinc installed, kitchen-omnibus-chef will use their implementations instead, providing:
- Enhanced features for enterprise Chef environments
- Licensed Chef product support
- Seamless upgrade path without configuration changes
When loading provisioners, kitchen-omnibus-chef checks for enterprise gems in this order:
- kitchen-chef-enterprise (Progress Chef Enterprise)
- kitchen-cinc (Cinc Project)
- kitchen-omnibus-chef (fallback, this gem)
To use enterprise features, install the enterprise gem alongside kitchen-omnibus-chef:
# For Progress Chef Enterprise
gem install kitchen-chef-enterprise
# For Cinc Project
gem install kitchen-cincOr in your Gemfile:
# Enterprise gem (higher priority)
gem 'kitchen-chef-enterprise'
# Standard gem (fallback)
gem 'kitchen-omnibus-chef'No configuration changes are needed - Test Kitchen will automatically use the enterprise implementation when available.
Once configured, use standard Test Kitchen commands:
# List all test instances
kitchen list
# Create and converge a specific instance
kitchen converge default-ubuntu-2204
# Run a full test cycle
kitchen test
# Destroy all instances
kitchen destroyBug reports and pull requests are welcome on GitHub at https://github.com/test-kitchen/kitchen-omnibus-chef.
Apache 2.0 (see LICENSE)