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!
When it comes to your
client.rb
I'd suggest looking into https://github.com/opscode-cookbooks/chef-clientIt'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 runchef-client -VV
andknife -VV
to see exactly what it's doing.