Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Chef Knife without a private key?

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?

like image 814
picardo Avatar asked Nov 14 '12 19:11

picardo


1 Answers

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' )
like image 55
PatrickWalker Avatar answered Sep 28 '22 02:09

PatrickWalker