Domanda

Configuration file written to /home/ubuntu/sudo /home/ubuntu/chef-repo/.chef/knife.rb

ubuntu@mychefclient:~$ knife client list
WARNING: No knife configuration file found
ERROR: Your private key could not be loaded from /etc/chef/client.pem
Check your configuration file and ensure that your private key is readable
È stato utile?

Soluzione

Please check once that the knife.rb file is there in .chef/knife.rb.

If not run the following command:

knife configure initial

so it will create knife.rb, then check the path of client key in knife.rb and cross check whether the client.pem is present on that location.

If this doesn't work.

just go to the client node and delete client.pem from /etc/chef, then run chef-client so it will create client.pem again. Now copy that client.pem on to the server and add that location into the knife.rb

It will work definitely :)

Altri suggerimenti

Adding to Jyoti and Alan's answer, you might also wanna try and create a user from the webui of chef from your browser.

Read the location of the client.pem from knife.rb. Now go to your browser and create a new user as admin and copy the private key. Remember the private key will not be shown again, so be alert on that front.

Create a file at that location and copy the contents.

Worked for me, hope it works for you.

Best of luck :)

In my case, running knife command from .chef folder helped

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top