knife on Windows inconsistently reads ~\.ssh\knife.rb on Management Workstation

Posted by gWaldo on Server Fault See other posts from Server Fault or by gWaldo
Published on 2012-08-29T15:32:40Z Indexed on 2012/08/29 15:40 UTC
Read the original article Hit count: 325

Filed under:
|
|
|

I am implementing a new instance of (Open-source v10.12) Chef in an existing environment. Currently the environment is mostly Windows, but more Linux is being introduced. I have used Chef in a previous gig, however that was a *nix-only environment.

Because this is a primarily-Windows environment, my main workstation is Windows 7 (x64), and I use Powershell as my main terminal.

I created a ~\.chef directory, populated with a knife.rb and my client.pem file. When I run knife client list from ~, I get the expected results.

I keep my work in Dropbox just in case my laptop should fail or be stolen. When I run knife client list from the repo directory (C:\Users\waldo\Dropbox_company\projects\chef`), I get

ERROR: Your private key could not be loaded from C:/home/waldo/.chef/waldog.pem Check your configuration file and ensure that your private key is readable

(Note that the path is incorrect)

This is the progression as I walk up the tree towards my ~ running knife client list:

C:\Users\waldo\Dropbox\_company\projects\ => Above error
C:\Users\waldo\Dropbox\_company\          => Above error
C:\Users\waldo\Dropbox\                   => It works!  (Expected results)
C:\Users\waldo\                           => Expected results
C:\Users\waldo\Documents\                 => Expected Results
C:\Users\waldo\Documents\GitHub           => Expected Results
C:\Users\waldo\Documents\GitHub\aProject\ => Expected Results

What. The. Eff!

Now, I know that I can add -c path\to\knife.rb, but that's a HUGE PITA.

Question is: Why is knife inconsistently reading my ~\.chef\knife.rb, and how can I get around that without incurring carpal tunnel?

© Server Fault or respective owner

Related posts about Windows

Related posts about windows-7