vagrant
https://github.com/mitchellh/vagrant
Ruby
Vagrant is a tool for building and distributing development environments.
Vagrant::Machine#ssh_info
This returns the SSH info for accessing this machine. This SSH info
is queried from the underlying provider. This method returns `nil` if
the machine is not ready for SSH communication.
The structure of the resulting hash is guaranteed to contain the
following structure, although it may return other keys as well
not documented here:
{
host: "1.2.3.4",
port: "22",
username: "mitchellh",
private_key_path: "/path/to/my/key"
}
Note that Vagrant makes no guarantee that this info works or is
correct. This is simply the data that the provider gives us or that
is configured via a Vagrantfile. It is still possible after this
point when attempting to connect via SSH to get authentication
errors.Edit
git clone [email protected]:mitchellh/vagrant.git
cd vagrant
open lib/vagrant/machine.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Vagrant--Machine-ssh_info-for-pr
# Commit to gitgit add lib/vagrant/machine.rbgit commit -m "better docs for Vagrant::Machine#ssh_info"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Vagrant--Machine-ssh_info-for-pr
hub pull-request
# Celebrate!