【发布时间】:2015-08-11 07:27:42
【问题描述】:
我正在尝试通过连接到 Chef 服务器来使用 Chef 配置 Vagrant 实例。
我的Vagrantfile 看起来像这样:
Vagrant.configure("2") do |config|
config.vm.box = "opentable/win-2012r2-standard-amd64-nocm"
config.vm.provider = "virtualbox"
config.vm.communicator = "winrm"
config.vm.guest = :windows
config.omnibus.chef_version = :latest
config.berkshelf.enabled = true
config.vm.provision :chef_client do |chef|
chef.chef_server_url = "https://chef.website.com"
chef.validation_key_path = "C:/chef/validation.pem"
chef.run_list = ["recipe[cookbook::default]"]
end
end
根据this documentation,这个Vagrantfile 应该包含我需要连接到厨师服务器并拉下相关食谱和数据包所需的所有字段。
但是,我在运行 Chef 客户端配置程序时遇到了以下错误:
The following berks command failed to execute:
C:\opscode\chefdk\embedded\bin/berks.BAT upload --berksfile C:/path/to/cookbook/Berksfile --no-freeze --force
The stdout and stderr are shown below:
stdout: E, [2015-08-10T17:02:57.654352 #8488] ERROR -- : Ridley::Errors::ClientKeyNotFoundOrInvalid: client key is not found or invalid or not found at: 'C:/chef/client.pem'
确实,client.pem 不存在。
虽然错误本身很容易解释,但我不明白为什么我需要在初始 Chef 客户端运行时指定 client.pem。
有没有办法让 Vagrant 自己创建它?更好的是,我可以让它完全不需要客户端标识符吗?
这只是一个 Vagrant 实例,所以我不需要在 Chef 服务器上保留这个节点。基于the Chef client provisioner documentation,我不明白为什么我需要client.pem 文件,因为说明中没有提到这一点。
感谢您的帮助!
【问题讨论】:
标签: vagrant chef-infra