drush-ops/drush — pull request #739 by greg-1-anderson (2014-07-25 21:51:06+00:00)
Title: Add better support for directly calling remote sites running on vagrant / virtualbox

Since vagrant is already managing my connection to my virtualbox servers, I don't want to have to redundantly manage permissions myself when using Drush. I just want to use the provided `vagrant ssh ` mechanism with Drush.

This patch allows me to make an alias that looks like this:
```
$aliases['mysite'] = array (
'vagrant' => '/home/ga/local/drupal-vagrant-environment',
'remote-host' => 'drupalhost',
'ssh-options' => '',
'command-specific' => array(
'user-login' => array(
'redirect-port' => '8484',
),
),
'uri' => 'http://mysite.mydomain.local',
'root' => '/srv/www/mysite.mydomain.local/drupal',
);
```
The 'vagrant' element tells backend invoke to use `vagrant ssh ` instead of `ssh @`. If this element is a string instead of a boolean, then Drush will also `cd` to this specified directory, where the Vagrantfile is. This makes `drush @mysite status` work seamlessly.

I also added the --redirect-port flag to the user-login command, so that I can seemlessly run `drush @mysite uli` to log in from my host. The site uri must remain 'http://mysite.mydomain.local', because that's what it is inside of the virtualbox guest. From the host, though, I have told vagrant to redirect port 80 to 8484, so user-login needs to find the site at 'http://mysite.mydomain.local:8484'.

I'm using this so that I can easily test a Drupal site running in a multiple-machine virtualbox environment with a simulated multiple-domain postfix setup. Vagrant is the bomb for this sort of thing, and it's nice to have Drush support too.