Vagrant chef-client配置因网络错误而失败

时间:2014-03-04 17:18:49

标签: chef vagrant

我正在尝试使用Vagrant和chef-client来配置VM,但是当它遇到chef-client配置块时我遇到了错误。我的Chef服务器在我的本地网络上设置。

我的VagrantFile看起来像这样:

config.vm.provision :chef_client do |chef|
  chef.chef_server_url =  "https://api.mychefserver.domain.com/organizations/org1"
  chef.validation_client_name = "org1-validator"
  chef.validation_key_path = "./chef-repo/.chef/org1-validator.pem"
  chef.add_recipe "my_recipe"
  chef.delete_node = true
  chef.delete_client = true
end

vagrant / chef-client的输出给了我这个错误:

[2014-03-04T11:10:22-06:00] INFO: *** Chef 11.10.4 ***
[2014-03-04T11:10:22-06:00] INFO: Chef-client pid: 16217
Creating a new client identity for vagrant-poc1.domain.com using the validator key.
[2014-03-04T11:10:22-06:00] INFO: Client key /etc/chef/client.pem is not present - registering

================================================================================
Chef encountered an error attempting to create the client "vagrant-poc1.domain.com"
================================================================================


Network Error:
--------------
There was a network error connecting to the Chef Server:
Error connecting to https://api.mychefserver.domain.com/organizations/org1/clients - getaddrinfo: Name or service not known



Relevant Config Settings:
-------------------------
chef_server_url  "https://api.mychefserver.domain.com/organizations/org1"

If your chef_server_url is correct, your network could be down.



[2014-03-04T11:10:22-06:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out

关于可能导致问题的任何想法。我最好的猜测是我正在使用不正确的网址为我的厨师服务器,但我似乎无法找到任何告诉我正确格式的内容。

1 个答案:

答案 0 :(得分:0)

想出来。正确的网址是https://mychefserver.domain.com/organizations/org1

在我的knife.rb文件中找到它。