Question

I want to use Chef Knife from the commandline for some basic things like creating data bags and cookbooks. The problem is it keeps failing me and complains that private key is missing.

ERROR: Your private key could not be loaded from /Users/newuser/.chef/newuser.pem Check your configuration file and ensure that your private key is readable

I know that I need Chef client to have the private key, but I only want to fly Solo. Is there a way to make Knife just work and stop it from complaining about the missing private key?

Was it helpful?

Solution

You could copy the webui pem key from the server?

Chef has that and a chef-validator client internally. The webui one is used for.the ui to make it's rest calls I believe so is.full admin.

I would stress normal behavior would be a client install and knife bootstrap and shouldn't offer much overhead but I think the webui key would work

The knife.rb would look something like

log_level                :info
log_location             STDOUT
node_name                'chef-webui'
client_key               'c:\chef\DEV\webui.pem'
validation_client_name   'chef-validator'
validation_key           'c:\chef\DEV\validation.pem'
chef_server_url          'http://yourserverhere.com:4000' 
cache_type               'BasicFile'
cache_options( :path => 'C:/chef/checksums' )

OTHER TIPS

Open your knife.rb file and remove/comment client_key, chef_server_url and any other lines that may need to connect to chef-server when executed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top