厨师从未成功完成

时间:2019-08-15 21:21:08

标签: vagrant chef chef-recipe

Mac OS X 10.14.5(Mojave)

VirtualBox 6.0.10 r132072

流浪汉2.2.5

Vagrant Box'bento / ubuntu-16.04'版本'201906.18.0'

  • 更新了VirtualBox和Vagrant。
  • 销毁并重新创建了Vagrant Box。

这刚刚开始发生,我重新安装了VirtualBox和Vagrant,更新了Vagrant Box,但无济于事:

    webdevMacMini-3:workspace Production2$ vagrant reload
==> default: [vagrant-hostsupdater] Removing hosts
==> default: Loading Berkshelf datafile...
==> default: Sharing cookbooks with VM
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'bento/ubuntu-16.04' version '201906.18.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Updating Vagrant's Berkshelf...
==> default: Resolving cookbook dependencies...
==> default: Fetching 'fsm-opsworks' from source at .
==> default: Using fsm-opsworks (0.1.0) from source at .
==> default: Using mysql (7.2.0)
==> default: Using rbac (1.0.3)
==> default: Using s3_file (2.8.5)
==> default: Using smf (2.2.8)
==> default: Using tar (0.7.0)
==> default: Using yum-mysql-community (4.0.1)
==> default: Vendoring fsm-opsworks (0.1.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/fsm-opsworks
==> default: Vendoring mysql (7.2.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/mysql
==> default: Vendoring rbac (1.0.3) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/rbac
==> default: Vendoring s3_file (2.8.5) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/s3_file
==> default: Vendoring smf (2.2.8) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/smf
==> default: Vendoring tar (0.7.0) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/tar
==> default: Vendoring yum-mysql-community (4.0.1) to /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default/yum-mysql-community
==> default: Using hostname "fsm-wp.env" as node name for Chef...
==> default: Using hostname "fsm-wp.env" as node name for Chef...
==> default: Fixed port collision for 80 => 80. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 (guest) => 2200 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: [vagrant-hostsupdater] Checking for host entries
==> default: [vagrant-hostsupdater] Writing the following entries to (/etc/hosts)
==> default: [vagrant-hostsupdater]   192.168.3.10  fsm-wp.env  # VAGRANT: 9c8c403ffecf0fd26e3d42e783a1c8b6 (default) / c43ab3ef-8862-4c71-80ed-63ee74e1f87c
==> default: [vagrant-hostsupdater] This operation requires administrative access. You may skip it by manually adding equivalent entries to the hosts file.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
==> default: Mounting NFS shared folders...
==> default: Mounting shared folders...
default: /tmp/vagrant-chef/f2698dd34370bffc552811ad1ca73223/nodes => /Users/Production2/Projects/fsm-wordpress/env
default: /tmp/vagrant-chef/1501064198d92cc9d39ef0e3346b2f11/cookbooks => /Users/Production2/.berkshelf/vagrant-berkshelf/shelves/berkshelf20190815-3252-j0pts7-default
default: /tmp/vagrant-chef/b1edb4edf9fc67ca95b5d1baa3f4b0e9/cookbooks => /Users/Production2/Projects/fsm-wordpress/env/cookbooks
default: /tmp/vagrant-chef/f12914f42c32d7648a3031384102f521/data_bags => /Users/Production2/Projects/fsm-wordpress/env/data_bags
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running provisioner: chef_solo...
==> default: Detected Chef (latest) is already installed
==> default: Generating chef JSON and uploading...
==> default: Running chef-solo...
==> default: 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.

很长一段时间以来我都没有更新任何食谱,直到今天我也没有更新Vagrant或VirtualBox。非常感谢任何见识!

3 个答案:

答案 0 :(得分:2)

您的输出中有一行提示出了什么问题

==> default: Chef Infra Client cannot execute without accepting the license

several ways to accept the license

  1.   

    用户可以在其Chef Infra Client和Chef Infra Server配置中指定chef_license 'accept'。在工作站上,可以在~/.chef/config.rb~/.chef/knife.rb中指定,而在节点上,可以在/etc/chef/client.rb中指定。

  2.   

    当调用Chef命令行工具并接受许可证时,要求用户也接受所有嵌入式产品的许可证。相同的许可证适用于所有产品,但每个产品必须具有自己的许可证接受。 chef <command> --chef-license accept将接受Chef工作站,Chef Infra客户端,Chef InSpec和Push Jobs客户端的许可证。例如,chef env –chef-license accept

发布时,将生成接受的许可证文件

$ ls -x1 ~/.chef/accepted_licenses/
chef_infra_client
chef_workstation
inspec

答案 1 :(得分:1)

我的解决方法是添加

chef.arguments = "--chef-license accept"

的末尾

config.vm.provision "chef_solo" do |chef|

按以下说明阻止我的Vagrantgilehttps://docs.chef.io/chef_license_accept.html#vagrant。谢谢@mr为我指出正确的方向!

答案 2 :(得分:0)

您可以使用以下命令接受厨师许可

chef-client --chef-license accept  > /dev/null