Knife bootstrap not finding validation.pem


#1

I’m trying to use knife to bootstrap a client, and in my knife.rb file, the
validation.pem path is listed as ~/.chef/validation.pem, When I run the
bootstrap process, I get a message indicating that validation.pem cannot be
found.

I did find though if I put a full path to the file, such as
/home/myuser/.chef/validation.pem, it does work. Is the ~/.chef path
interpreted as relative to the ssh user (the user running the knife bootstrap
is different than the ssh username). I wouldn’t think so, but I’m not sure.

Any reason why this wouldn’t work?


#2

try
"#{ENV[‘HOME’]}/.chef/validation.pem"

i guess ~ is only understood by shell, not by ruby

On Mon, Oct 29, 2012 at 8:44 PM, jeff.storey@nextcentury.com wrote:

I’m trying to use knife to bootstrap a client, and in my knife.rb file, the
validation.pem path is listed as ~/.chef/validation.pem, When I run the
bootstrap process, I get a message indicating that validation.pem cannot be
found.

I did find though if I put a full path to the file, such as
/home/myuser/.chef/validation.pem, it does work. Is the ~/.chef path
interpreted as relative to the ssh user (the user running the knife
bootstrap
is different than the ssh username). I wouldn’t think so, but I’m not sure.

Any reason why this wouldn’t work?


#3

That seems to work, but in the client key file I have
~/.chef/myuser.pem. I wonder why it would work in one case but not the
other.

On 10/29/2012 11:38 AM, Ranjib Dey wrote:

try
"#{ENV[‘HOME’]}/.chef/validation.pem"

i guess ~ is only understood by shell, not by ruby

On Mon, Oct 29, 2012 at 8:44 PM, <jeff.storey@nextcentury.com
mailto:jeff.storey@nextcentury.com> wrote:

I'm trying to use knife to bootstrap a client, and in my knife.rb
file, the
validation.pem path is listed as ~/.chef/validation.pem, When I
run the
bootstrap process, I get a message indicating that validation.pem
cannot be
found.

I did find though if I put a full path to the file, such as
/home/myuser/.chef/validation.pem, it does work. Is the ~/.chef path
interpreted as relative to the ssh user (the user running the
knife bootstrap
is different than the ssh username). I wouldn't think so, but I'm
not sure.

Any reason why this wouldn't work?

#4

On Monday, October 29, 2012 at 8:40 AM, Jeff Storey wrote:

That seems to work, but in the client key file I have ~/.chef/myuser.pem. I wonder why it would work in one case but not the other.

In ruby, you need to call File.expand_path to get expand tildes.

Feel free to file a ticket for this, or better yet, make a patch. If you have the stack trace, it should be pretty easy to locate the spot where you should add expand_path and add it.


Daniel DeLeo


#5

Will do.
On 10/29/2012 11:45 AM, Daniel DeLeo wrote:

On Monday, October 29, 2012 at 8:40 AM, Jeff Storey wrote:

That seems to work, but in the client key file I have
~/.chef/myuser.pem. I wonder why it would work in one case but not
the other.

In ruby, you need to call File.expand_path to get expand tildes.

Feel free to file a ticket for this, or better yet, make a patch. If
you have the stack trace, it should be pretty easy to locate the spot
where you should add expand_path and add it.


Daniel DeLeo