If you're getting errors like:
+---------------------------------------------+
Chef License Acceptance
Before you can continue, 2 product licenses
must be accepted. View the license at
https://www.chef.io/end-user-license-agreement/
Licenses that need accepting:
* Chef Infra Client
* Chef InSpec
Do you accept the 2 product licenses (yes/no)?
If you're on test-kitchen < 2.2 and accept the Chef 15 EULA (are a customer or only evaluating)
NOTE: this is future compatible as well
provisioner:
name: chef_zero
product_name: chef
product_version: 15
client_rb:
chef_license: accept
If you're on test-kitchen >= 2.2 and accept the Chef 15 EULA (are a customer or only evaluating)
provisioner:
name: chef_zero
product_name: chef
product_version: 15
chef_license: accept-no-persist
If you don't accept the EULA and want to stick with Chef 14
provisioner:
name: chef_zero
product_name: chef
product_version: 14
Make the above changes to kitchen.yml
accordingly.
Add/edit the execute_command
for the Chef provisioners to include the license accceptance flag.
"provisioners": [
{
"type": "chef-solo",
"execute_command": "{{if .Sudo}}sudo {{end}}chef-client --no-color -c {{.ConfigPath}} -j {{.JsonPath}} --chef-license accept-no-persist",
}
]
More information available at https://www.packer.io/docs/provisioners/chef-client.html#execute_command
provisioner "chef" {
version = "15"
client_options = [ "chef_license 'accept'" ]
}