gersen
gersen

Reputation: 1

Unable to bootstrap a node from chef workstation

I've an issue with chef , when i try to bootstrap a node .I installed a server and a workstation after i tried to bootstrap a node but it's impossible i got this error message: enter image description here

Before bootstrapping i generated a knife.rb for the client with knife configure client .

Thanks,

Upvotes: 0

Views: 1158

Answers (2)

kalyani chaudhari
kalyani chaudhari

Reputation: 7839

Below command for bootstrapping ubuntu linux machine works fine for me.

/home/ubuntu/chef-repo/.chef# sudo knife bootstrap -i <.pem_file_of_client_machine> <pubic_IPV4_Address/DNS_of_client_machine> -x ubuntu --node-name <node_name> --sudo --run-list "recipe[<cookbook_name>]"

where,

pem_file_of_client_machine --> private key to connect with client node

pubic_IPV4_IP/DNS_of_client_machine --> Public IP address/ DNS of the client machine

node_name --> String representing node name

cookbook_name --> Cookbook that we want to execute on client machine

  • Verify Username/Password you are providing or you can try providing private key(.pem file). User should have root permissions on machine.

  • Make sure boostraping steps you are performing from ~/chef-repo/.chef directory where you have private keys of chef server and trusted certs. You can download chef server cert with below command

    /home/ubuntu/chef-repo# knife ssl fetch
    

Upvotes: 0

Mark O&#39;Connor
Mark O&#39;Connor

Reputation: 77941

You're getting a HTTP 401 error, meaning you are failing to authenticate against the chef server.

To test my knife.rb file I always run a simple command like:

knife client list

I would expect that fails for you? You need a functioning chef workstation before attempting to bootstrap new nodes.

Upvotes: 1

Related Questions