Open derhornspieler opened 4 years ago
Any update on this?
You need to accept the Chef license, or use an older Chef version. https://docs.chef.io/chef_license_accept/#vagrant
related to this I had the issue:
starting remote command: sudo chef-solo --no-color -c /tmp/packer-chef-solo/solo.rb -j /tmp/packer-chef-solo/node.json
amazon-ebs: Chef Infra Client cannot execute without accepting the license
I solved it with setting the env variable CHEF_LICENSE (https://docs.chef.io/chef_license_accept/):
"provisioners": [
{
"type": "chef-solo",
"cookbook_paths": [
"{{template_dir}}/../../../chef/cookbooks"
],
"execute_command": "export CHEF_LICENSE=accept-silent",
I've found that if I add the execute_command from mmuller88 that all of my run_list is skipped over.
Ubuntu 20.04 with packer version 1.3.4.
I looked at https://www.packer.io/plugins/provisioners/chef/chef-solo#chef_license with the configuration option chef_license, but I just get this error:
1 error occurred:
So it appears that a version limitation can cause this to still fail.
The example from: https://github.com/chef/license-acceptance/issues/58 helped
"execute_command": "{{if .Sudo}}sudo {{end}}chef-solo --chef-license accept-silent -c {{.ConfigPath}} -j /tmp/packer-chef-solo/node.json",
Attempting to install versions/pro of the win2k8 and ub1404 via Vagrantfile
Host System
Command Output
==> win2k8: C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/ffi-1.12.1-x86-mingw32/lib/ffi/struct.rb:207:in' will be disallowed in ffi-2.0. (StructuredWarnings::StandardWarning)
==> win2k8: Chef Infra Client cannot execute without accepting the license
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
layout': [DEPRECATION] Struct layout is already defined for class Windows::ServiceStructs::SERVICE_STATUS_PROCESS. Redefinition as in C:/opscode/chef/embedded/lib/ruby/gems/2.6.0/gems/win32-service-2.1.4/lib/win32/windows/structs.rb:72:in