xforty / vagrant-drupal

Template repo for a new drupal project built on top of a vagrant vm.
Other
46 stars 11 forks source link

Drush doesn't make outbound ssh connections in certain cases #80

Open dkingofpa opened 11 years ago

dkingofpa commented 11 years ago

If the vm hostname and drush alias remote-host has the same domain name, drush may not work. Basically, if I have:

Vagrantfile: config.vm.host_name = 'example' aliases.drushrc.php:

$aliases['dev'] = array(
  'root' => '/var/www/',
  'remote-host' => 'example.com',
  'remote-user' => 'myuser',
);

Then drush won't make outbound ssh connections in certain situations such as sql-sync or status. This is due to some code in drush that tries to determine the host to be called. If it thinks it's already on the remote host, it won't try to ssh out.

To fix, we can set remote_host to www.example.com if applicable or the remote host's actual ip address.

We need to have documentation and a warning. Or maybe just have a vm hostname naming convention of local-<hostname>?

pearcec commented 11 years ago

If you name the vm local-hostname that will mean you will have to use local-hostname.local to access the website via the web browser using avahi. That is the whole reason we set config.vm.host_name = 'example' in the first place. Otherwise why not just keep it ubuntu.