Search code examples
chef-solochef-infra

Unable to Bootstrap node using Chef


I've set up a basic Chef infrastructure that contains a workstation, a hosted Chef Server and an Ubuntu Server to serve as a node. I'm using this setup at my workplace and therefore a proxy is required for internet connections. I've made the necessary proxy settings in both knife.rb and the Ubuntu Server. Both the workstation and the node are properly connected to the internet. Here's the problem - When I try to bootstrap this node using knife, I get the following error:

<My Node's IP> --2014-02-12 10:29:05--  https://www.opscode.com/chef/install.sh
<My Node's IP> Resolving www.opscode.com (www.opscode.com)... 184.106.28.91
<My Node's IP> Connecting to www.opscode.com (www.opscode.com)|184.106.28.91|:443... failed: Connection refused.
<My Node's IP> bash: line 83: chef-client: command not found

Please note that I used the following command to bootstrap the node -

knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name> 

Can you please help me with this? Thanks in advance.


Solution

  • After struggling on this for a long time I have finally found the answer. In knife.rb another entry for bootstrap-proxy has to made as well.

    knife[:bootstrap_proxy] = "http://username:password@proxy:port"
    

    After doing this, run the following bootstrap command -

    knife bootstrap <My Node's IP> --sudo -x <username> -P <password> -N <name>
    

    This worked for me!