chef.client_key_path in vagrant file do not copy client pem file

75 views
Skip to first unread message

Moshe Zuisman

unread,
Nov 4, 2015, 8:51:35 AM11/4/15
to Vagrant
Hi,
I am working with chef server , that I created at AWS machine (Redhat 7). Chef server version is 12.
My vagrant file looks like:
  config.vm.provision :chef_client do |chef|
   chef
.node_name = 'my_node'
   chef
.chef_server_url = 'https://ec2-<my_chef_server_ip>.us-west-2.compute.amazonaws.com/organizations/my_org'
   c
= 'c:\my_chef_fir\chef-repo\.chef\my-validator.pem'
   chef
.validation_client_name = 'my-validator'
   chef
.client_key_path = 'c:\my_chef_fir\chef-repo\.chef\client.pem'
   chef
.provisioning_path = "/etc/chef"
   chef
.log_level = :debug
   chef
.run_list = [ "recipe[AmazonTest::touch_file]" ]
 
end
Введите код...

When I run it I get chef failure and at log file I see:
40:57+00:00] INFO: Client key c:my_chef_firch ef-repo.chefclient.pem is not present - registering

And 401 - not Authorised


If I manually copy client.pem into /etc/chef and run vagrant provision - it works...
Why vagrant copy into provisioning virtual machine file from line
chef.client_key_path, but perfectly copy chef.client_key_path?
Is there a way to cause vagrant to do such a copy, or - I have to do it manually (that means through sync folders or shell provisioner) before chef_client provisioner?

Alvaro Miranda Aguilera

unread,
Nov 5, 2015, 5:33:57 AM11/5/15
to vagra...@googlegroups.com
Hello

Looks like the path is not being read correctly

can you try to escape:

option 1:
chef.client_key_path = 'c:\\my_chef_fir\\chef-repo\\.chef\\client.pem'

option 2:
chef.client_key_path = 'c:/my_chef_fir/chef-repo/.chef/client.pem'

Thanks
Alvaro.
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/f03a0983-525e-4a73-a142-330d398e127c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Moshe Zuisman

unread,
Nov 8, 2015, 5:15:06 AM11/8/15
to Vagrant
  1. I have tried chef.client_key_path = 'c:/my_chef_fir/chef-repo/.chef/client.pem' It failed also.
  2. chef.validation_key_path = 'c:\DevOps_with_chef_server\AWS_Chef_Server\chef-repo\.my-validator.pem' - works with no problem... Vagrant copies those file to bootstraped instance...

четверг, 5 ноября 2015 г., 12:33:57 UTC+2 пользователь Alvaro Miranda Aguilera написал:

Alvaro Miranda Aguilera

unread,
Nov 9, 2015, 3:06:42 AM11/9/15
to vagra...@googlegroups.com
Hello,

So you are ok or something is still failing?


Take note in Windows the slash \ should be escaped \\

"c:\\path\\to\\the\file"

Thanks
Alvaro.
> https://groups.google.com/d/msgid/vagrant-up/59d69e03-9e62-48a8-83a5-242bf2f44283%40googlegroups.com.
Message has been deleted

Moshe Zuisman

unread,
Aug 2, 2016, 4:54:42 AM8/2/16
to Vagrant
Hi Alvaro. Now it seems to be Ok


Reply all
Reply to author
Forward
0 new messages