Chef and ec2 download knife - OpenSSL :: PKey :: RSAError: private key needed: no start line

I'm a newbie trying to boot and an ec2 instance, and nothing works with the chef.

  • I am using a chef server
  • My development computer has an ubuntu username. I want to keep it with the same name as ubuntu for ec2.

I tried this command.

ubuntu@ubuntu :~/.chef$ knife ec2 server create -x ubuntu -r "role[testredis]" --region ap-southeast-1 -Z ap-southeast-1a -i ami-ae1a5dfc -f t1.micro -S testpem -I ~/.ec2/testpem.pem -S knife --ssh-user ubuntu 

And I got the following output

 ERROR: You have not provided a valid image (AMI) value. Please note the short option for this value recently changed from '-i' to '-I'. 

Then I tried the following.

 knife bootstrap ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com -r "role[testredis]" -x ubuntu -i ~/.ec2/sg_development.pem --sudo 

And I got the following output

 ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com /usr/bin/knife ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com /usr/bin/shef ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com Successfully installed chef-0.10.8 ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com 1 gem installed ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:02 +0000] INFO: *** Chef 0.10.8 *** ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] INFO: Client key /etc/chef/client.pem is not present - registering ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out ec2-46-137-231-241.ap-southeast-1.compute.amazonaws.com [Fri, 23 Mar 2012 23:56:03 +0000] FATAL: OpenSSL::PKey::RSAError: private key needed.: no start line 

I notice that /etc/chef/client.pem in the ec2 instance is the pem on the dev machine where I ran the knife command.

So what should I do? Is that the name node?

+4
source share
1 answer

It looks like you have a missing or incorrect validation key. You need this from your chef-server or Opscode Hosted Chef account in order to register new nodes with the server. Check your configuration in .chef / knife.rb . You need a validation key (usually " ORGNAME-validator.pem "), and this is NOT the same as client.pem.

http://wiki.opscode.com/display/chef/Authentication+and+Authorization

+6
source

Source: https://habr.com/ru/post/1403180/


All Articles