Bootstrapping issues in Chef

混江龙づ霸主 提交于 2019-12-08 01:34:28

问题


I have setup a basic infrastructure using chef. This includes a local chef server(ubuntu based), workstation and an ubuntu based server(to be used as the node). Please note that the entire infrastructure lies behind the firewall in my office network. And I have made necessary proxy settings for the servers to access the internet. So here is the problem - When I try to bootstrap the node using -

knife bootstrap <node's ip> --sudo -x <username> -P <password> -N "<name>"

i get the following error

<node's ip> --2014-02-19 10:47:10--  https://www.opscode.com/chef/install.sh
<node's ip> Resolving www.opscode.com (www.opscode.com)... 184.106.28.91
<node's ip>1 Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... failed:Connection refused.
<node's ip> bash: line 83: chef-client: command not found

I was not able to find a solution to this. However I came across the knife[:bootstrap_proxy] = "http://username:password@proxyIP:port/" setting that can be added to knife.rb . I did this (by entering my office proxy details) and then the connection during bootstrap was successfull and the chef client was downloaded on the node. However this setting only defines the proxy that should be used by the node. So, this led to the http_proxy = "http://username:password@proxyIP:port/" being set in client.rb. But because I have already made all the proxy settings in my server, the chef client failed to launch. So I manually removed the http_proxy and https_proxy settings from client.rb and ran the command chef-client which was then successful. I have two questions -

1) why did knife[:bootstrap_proxy] = "http://username:password@proxyIP:port/" work? because it only defines the proxy that should be used by the node.

2) Also, alll the proxy setting for the node has already been done. I do not want any proxy settings in client.rb. How do I achieve this?

Please help!


回答1:


When it comes to your client.rb I'd suggest looking into https://github.com/opscode-cookbooks/chef-client

It's a wrapper script for client.rb(s).

Not sure about your knife[:bootstrap_proxy] though. Ideally that cookbook should take care of it. If you are still stumpped you can run chef-client -VV and knife -VV to see exactly what it's doing.



来源:https://stackoverflow.com/questions/21871964/bootstrapping-issues-in-chef

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!