im trying to add the chef-client to my packer builds. To do this im using
amazon-ebs: [2019-03-06T15:06:12+00:00] WARN: Failed to read the private key /etc/chef/validation.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /etc/chef/validation.pem>
amazon-ebs:
amazon-ebs: ================================================================================
amazon-ebs: Chef encountered an error attempting to create the client "packer-5c7fe1db-8e69-16d3-e6a6-a3f654ca501a"
amazon-ebs: ================================================================================
amazon-ebs:
amazon-ebs: Private Key Not Found:
amazon-ebs: ----------------------
amazon-ebs: Your private key could not be loaded. If the key file exists, ensure that it is
amazon-ebs: readable by chef-client.
amazon-ebs:
amazon-ebs: Relevant Config Settings:
amazon-ebs: -------------------------
amazon-ebs: validation_key "/etc/chef/validation.pem"
amazon-ebs:
amazon-ebs: System Info:
amazon-ebs: ------------
amazon-ebs: chef_version=14.10.9
amazon-ebs: ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
amazon-ebs: program_name=/usr/bin/chef-client
amazon-ebs: executable=/opt/chef/bin/chef-client
amazon-ebs:
amazon-ebs:
amazon-ebs: Running handlers:
amazon-ebs: [2019-03-06T15:06:12+00:00] ERROR: Running exception handlers
amazon-ebs: Running handlers complete
amazon-ebs: [2019-03-06T15:06:12+00:00] ERROR: Exception handlers complete
amazon-ebs: Chef Client failed. 0 resources updated in 01 seconds
amazon-ebs: [2019-03-06T15:06:12+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
amazon-ebs: [2019-03-06T15:06:12+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
amazon-ebs: [2019-03-06T15:06:12+00:00] FATAL: Chef::Exceptions::PrivateKeyMissing: I cannot read /etc/chef/validation.pem, which you told me to use to sign requests!
amazon-ebs: Creating configuration file 'knife.rb'
==> amazon-ebs: Cleaning up chef node...
amazon-ebs: WARN: Failed to read the private key /tmp/packer-chef-client/mykey.pem: #<Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/packer-chef-client/mykey.pem>
amazon-ebs: ERROR: Your private key could not be loaded from /tmp/packer-chef-client/mykey.pem
amazon-ebs: Check your configuration file and ensure that your private key is readable
==> amazon-ebs: Terminating the source AWS instance...
==> amazon-ebs: Cleaning up any extra volumes...
==> amazon-ebs: No volumes to clean up, skipping
==> amazon-ebs: Deleting temporary security group...
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' errored: Error cleaning up chef node: Failed to cleanup node: Non-zero exit status. See output above for more info.
Command: sudo knife node delete packer-5c7fe1db-8e69-16d3-e6a6-a3f654ca501a -y -c /tmp/packer-chef-client/knife.rb
==> Some builds didn't complete successfully and had errors:
--> amazon-ebs: Error cleaning up chef node: Failed to cleanup node: Non-zero exit status. See output above for more info.
Command: sudo knife node delete packer-5c7fe1db-8e69-16d3-e6a6-a3f654ca501a -y -c /tmp/packer-chef-client/knife.rb