“Chef Infra Client cannot execute without accepting the license”が発生した時の対処

Vagrantでchef-soloをprovisionerとしたupコマンド実行時に以下のようなエラーが発生するようになった。

==> host01: 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.

chefのライセンス形態が変更になり、最新Chef v15から初回にEULA(End-User License Agreement)の承諾が必要になったもよう。

As of May 15, 2019, we have released Chef Infra Client version 15, which requires accepting the new EULA.

https://docs.chef.io/chef_license_accept.html

chefのコマンドから実行した場合は、以下のような対話方式で承諾する。

+---------------------------------------------+
            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)?

>

オプションを引き渡すことでも承諾可能なようだがうまく動作せず。関連ツールを含め全てがまだ対応できていないからv14に固定してともあるので、

However, we are still in the process of releasing the rest of our product portfolio. As of today, the recommendation is to pin Chef Infra Client to version 14 until we add support to the rest of our tooling.

https://docs.chef.io/chef_license_accept.html

Vagrantfileに以下のように、chefのバージョンをv14の最新に固定するように変更。

Vagrant.configure("2") do |config|
  # 省略
    cfg.vm.provision "chef_solo" do |chef|
      chef.version = "14.12.9"
      # 省略
    end
  # 省略
end

動いた!