diff --git a/scripts/drupal-vm/drupal-vm.aliases.drushrc.php b/scripts/drupal-vm/drupal-vm.aliases.drushrc.php index dd807f1b9..81fe787ec 100644 --- a/scripts/drupal-vm/drupal-vm.aliases.drushrc.php +++ b/scripts/drupal-vm/drupal-vm.aliases.drushrc.php @@ -1,11 +1,13 @@ -// [vagrant_machine_name].local +// Local environment. $aliases['${project.machine_name}.local'] = array( - // /var/www/[vagrant_machine_name]/docroot 'root' => '/var/www/${project.machine_name}/docroot', - // vagrant_hostname 'uri' => '${project.local.uri}', - // vagrant_hostname - 'remote-host' => '${project.local.hostname}', - 'remote-user' => 'vagrant', - 'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key' -); + ); +// Add remote connection options when alias is used outside VM. +if ('vagrant' != $_SERVER['USER']) { + $aliases['${project.machine_name}.local'] += array( + 'remote-host' => '${project.local.hostname}', + 'remote-user' => 'vagrant', + 'ssh-options' => '-o PasswordAuthentication=no -i ' . drush_server_home() . '/.vagrant.d/insecure_private_key' + ); +}