rapid7 / metasploitable3

Metasploitable3 is a VM that is built from the ground up with a large amount of security vulnerabilities.
Other
4.78k stars 1.15k forks source link

Chef Error #441

Open derhornspieler opened 4 years ago

derhornspieler commented 4 years ago

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 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' 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.

samanthakem commented 4 years ago

Any update on this?

Sliim commented 4 years ago

You need to accept the Chef license, or use an older Chef version. https://docs.chef.io/chef_license_accept/#vagrant

mmuller88 commented 3 years ago

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",
rbeede commented 2 years ago

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.

rbeede commented 2 years ago

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",