chef-infra - 接受版本 >= 14 的 Chef Infra Client 许可协议
问题描述
我正在尝试通过使用命令使用厨师引导节点knife bootstrap <host> --ssh-user '<username>' -i <my-identity>.pem --sudo --use-sudo-password --node-name <node-name> --run-list 'recipe[<cookbook-name>::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 boostrap
在 chef 14.0 之前,我曾经能够轻松运行命令。似乎他们升级到 Chef 14.0 并且新升级对许可协议有强制性要求。我如何同意从主机进入客户端机器的许可?
解决方案
基本上,根据我的发现,这个问题可能出现在两种不同的情况下:
当你运行
kitchen converge
.kitchen.yml
通过在as中添加一段代码可以很容易地解决这个问题provisioner: client_rb: chef_license: accept
当您运行 时
knife bootstrap
,这可能是一些额外的工作。这个页面 解释了所有需要做的事情。目录里面.chef
。
> mkdir bootstrap
> cd bootstrap && touch template.erb
> find /opt/chefdk/embedded/lib/ruby -type f -name chef-full.erb -exec cat {} \; > template.erb
找到那部分说的那行
cat > /etc/chef/client.rb <<'EOP
<%= config_content %>
EOP
并将其替换为
cat > /etc/chef/client.rb <<'EOP'
<%= config_content %>
chef_license "accept"
EOP
接下来,运行命令knife bootstrap <host> --ssh-user '<username>' -i <my-identity>.pem --sudo --use-sudo-password --node-name <node-name> --boostrap-template "template" --run-list 'recipe[<cookbook-name>::default]'
。那照顾了它。
推荐阅读
- vue.js - Vue - 将带有冒号的道具传递到组件时出现问题
- python - 用 0 替换每个字符串值
- java - How to get selective columns in Export Csv in Spring boot
- php - json_decode 不带引号的值
- android - 无法在 Mac 的设备和模拟器中运行我的 Android 应用程序
- c# - 经典 ASP.Net 上的 Serilog 配置(非核心)?
- kubernetes - 在 Kubernetes 集群上运行 Common Lisp 应用程序
- wordpress - 为什么我的网站在谷歌搜索控制台中显示移动可用性错误?(只有 wp-content 页面显示此错误)
- reactjs - 如何使用 react-native、reduxsauce、apisauce、reducers 和 saga 在 API 中执行可变 URL?
- sql-server - Informatica PowerCenter - 存储过程转换不返回任何内容