Details
Description
I'm using the Opscode Platform with Knife, and the ssh subcommand is broken. Here's an example of the output:
$ knife ssh -l debug name:i-b9e468d3
DEBUG: Using configuration from /Users/bhelmkamp/p/active/e20_chef_repo/.chef/knife.rb
DEBUG: Signing the request as bhelmkamp
DEBUG: Sending HTTP Request via GET to api.opscode.com:443/organizations/efficiency20/search/node
DEBUG: Adding ip-10-204-103-221.ec2.internal
/Users/bhelmkamp/.rvm/gems/ree-1.8.7-2010.01/gems/net-ssh-2.0.23/lib/net/ssh/transport/session.rb:65:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
Looks like somewhere along the way it's getting confused and using the EC2 internal hostname instead of the public one. Any ideas? Not sure if this is an issue with Knife or the Opscode Platform.
This is the expected behavior, although it's surprising. EC2 instances use the internal host address as the hostname, which means ohai/node data has the internal address.
You can add '-a ec2.public_hostname' to tell knife which piece of the node data to use as the hostname.