Chef infra 接受Chef Infra客户端许可协议版本>;=14

Chef infra 接受Chef Infra客户端许可协议版本>;=14,chef-infra,chef-recipe,cookbook,Chef Infra,Chef Recipe,Cookbook,我正在尝试使用chef引导一个节点,方法是使用命令knife bootstrap--ssh用户''-I.pem--sudo--use sudo password--node name--run list'recipe[::default]' 但是,它失败了,因为我不能接受许可证 4 -----> Existing Chef installation detected 137.252.24.94 Starting the first Chef Client run... 137.252.24

我正在尝试使用chef引导一个节点,方法是使用命令
knife bootstrap--ssh用户''-I.pem--sudo--use sudo password--node name--run list'recipe[::default]'

但是,它失败了,因为我不能接受许可证

4 -----> Existing Chef installation detected
137.252.24.94 Starting the first Chef Client run...
137.252.24.94 +---------------------------------------------+
137.252.24.94             Chef License Acceptance
137.252.24.94
137.252.24.94 Before you can continue, 2 product licenses
137.252.24.94 must be accepted. View the license at
137.252.24.94 https://www.chef.io/end-user-license-agreement/
137.252.24.94
137.252.24.94 Licenses that need accepting:
137.252.24.94   * Chef Infra Client
137.252.24.94   * Chef InSpec
137.252.24.94
137.252.24.94 Do you accept the 2 product licenses (yes/no)?

我无法从主机输入答案。在chef 14.0之前,我曾经能够轻松地运行
chef boostrap
命令。看起来他们升级到了Chef 14.0,新的升级对许可协议有强制性要求。如何将许可证从主机许可到客户机?

基本上,根据我的发现,此问题可能发生在两种不同的情况下:

  • 当您运行
    厨房时,请使用converge
    。通过在
    kitchen.yml
    as中添加一段代码,可以很容易地解决这个问题

    provisioner:
      client_rb:
        chef_license: accept
    
  • 当您运行
    刀引导时
    ,这可能是一点额外的工作。这就解释了所有需要做的事情。在
    .chef
    目录中

  • 找出那一部分所说的那一行

    cat > /etc/chef/client.rb <<'EOP
    <%= config_content %>
    EOP
    

    cat>/etc/chef/client.rb您可以使用以下行接受许可证

    chef-client --chef-license accept  > /dev/null
    
    cat > /etc/chef/client.rb <<'EOP'
    <%= config_content %>
    chef_license "accept"
    EOP
    
    chef-client --chef-license accept  > /dev/null