hol*_*lms 30 chef-infra vagrant chef-solo
当使用vagrant和chef作为供应者时,我收到了这个警告:
[web] Chef 11.12.2 Omnibus package is already installed.
[web] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
stdin: is not a tty
[2014-04-10T14:48:46+00:00] INFO: Forking chef instance to converge...
[2014-04-10T14:48:46+00:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.
To fix this issue add an entry like this to your configuration file:
```
# Verify all HTTPS connections (recommended)
ssl_verify_mode :verify_peer
# OR, Verify only connections to chef-server
verify_api_cert true
```
To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:
```
knife ssl check -c /tmp/vagrant-chef-1/solo.rb
```
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Run Code Online (Sandbox Code Playgroud)
很高兴知道厨师在Vagrantfile中需要什么样的设置才能解决这个问题.
Hol*_*ust 47
这个警告是在Chef 11.12.0中引入的.有关详细信息,请参阅发行说明
当
ssl_verify_mode设置为:verify_none,厨师会打印一个警告.使用knife ssl check测试SSL连接,然后添加ssl_verify_mode :verify_peer到您的配置文件来修复该警告.虽然:verify_none目前是默认版本,但将在未来版本中进行更改,因此鼓励用户主动测试和更新其SSL配置.
要在Vagrant中修复此警告,您必须修改solo.rb它在VM中创建的配置文件.使用Vagrant,您可以使用该custom_config_path选项.
你可以这样修改你的Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.provision "chef_solo" do |chef|
# the next line is added
chef.custom_config_path = "Vagrantfile.chef"
end
end
Run Code Online (Sandbox Code Playgroud)
这使得Vagrant将本地文件的内容包含在Vagrantfile.chef生成的solo.rb中,因此该文件需要存在于主机系统上,而不是VM上.
然后,Vagrantfile.chef在目录中创建一个新文件,您还可以使用以下内容保存Vagrantfile:
Chef::Config.ssl_verify_mode = :verify_peer
Run Code Online (Sandbox Code Playgroud)
下一次运行vagrant provision应该不再打印警告.
Zxa*_*aos 12
我在使用测试厨房时遇到了这个问题.
如果您也是这种情况,请注意,此值也可以直接在内部配置.kitchen.yml.
如果您的标准配置程序块如下所示:
provisioner:
name: chef_solo
Run Code Online (Sandbox Code Playgroud)
您可以solo_rb使用ssl_verify_mode选项添加密钥:
provisioner:
name: chef_solo
solo_rb:
ssl_verify_mode: verify_peer
Run Code Online (Sandbox Code Playgroud)
并且生成的solo.rb将设置此选项.
我知道最初的问题是关于Vagrant,但对于使用knife-sologem并遇到此错误的人,只需将以下行添加到.chef/knife.rb:
ssl_verify_mode :verify_peer
Run Code Online (Sandbox Code Playgroud)
在knife-solo创业板将采取价值和放入solo.rb的是被上传到服务器,这是传递给主配置文件文件chef-solo.
| 归档时间: |
|
| 查看次数: |
9092 次 |
| 最近记录: |