fnichol / knife-server

A Chef Knife plugin to manage Chef Servers. Bootstrap a new Chef Server on Amazon's EC2, Digital Ocean, Linode, OpenStack or a standalone server. Backup and restore your Chef Server or Hosted Chef's node, role, data bag, and environment JSON data.
http://fnichol.github.com/knife-server
Apache License 2.0
158 stars 34 forks source link

Standalone bootstrap requires any arbitrary identity file #14

Closed bendemaree closed 11 years ago

bendemaree commented 11 years ago

Hello...wonderful library, thanks for all of your work!

Just wanted to let you know of a potential bug. When using knife server bootstrap standalone (in this case against a vagrant-provisioned box), the --identity-file option is in fact required. If it is not passed with some key, the net-ssh command is called with an empty keys argument, which it tries to use. The error given without it is

/Library/Ruby/Gems/1.8/gems/net-ssh-2.2.2/lib/net/ssh/authentication/key_manager.rb:64:inexpand_path': can't convert nil into String (TypeError)`

Just to clarify, an associated key is not required, just any key.

The full command I am executing is

knife server bootstrap standalone --node-name master --host master --identity-file ~/mykey.pem --ssh-user vagrant --ssh-password vagrant

Thanks; if I knew more Ruby I'd fix 'er up myself. Alas...

fnichol commented 11 years ago

Thanks @bendemaree for reporting, and you are right on here. I just pulled in @erikh's #15 and cutting v0.3.3 now. If we didn't beat this one down, please reopen. Thank you!

bendemaree commented 11 years ago

Great @fnichol and @erikh! Prompt fix! I'll be able to pull it down soon and test.

Happy holidays!