If there is a site alias definition that looks like this:

$options['site-aliases']['sitename'] = array (
  'remote-host' => 'servername.com',
  'remote-user' => 'publisher',
);

That is, if it contains a 'remote-host' but no uri or root information, then drush should use a remote call to 'drush site-alias sitename --full' to pull over a full alias record for the remote site. If the remote settings contain different values for 'remote-host' and 'remote-user', then they will take precedence over the local values, so it will be possible to store alias settings in a central location if desired.

An alternate (or additional) idea would be to define an 'alias server' that would be queried to get available names, maybe something like this:

$options['alias-server'] = array (
  'remote-host' => 'servername.com',
  'remote-user' => 'publisher',
);

Drush would use a remote call to drush site-alias --pipe to get a list of aliases managed by the alias server. It would be necessary to cache the result of this call in some file, so that drush did not need to make a remote call for every command dispatched. Also, there is some question about when the cache would be cleared.

This feature is related to #723288: Introduce the concept of 'shortnames' for all major entities..

Comments

adrian’s picture

We should introduce a new 'aliases' variable for configuration files.

so

$aliases['somealias'] = array( /* properties */ );
greg.1.anderson’s picture

See reply in #727058: Site aliases should not be cached in the options context; this change really belongs there.

greg.1.anderson’s picture

My suggestion above is not good; there might be occasion to want to have an alias that refers to a server (that is, has 'remote-host' and 'remote-user' entities) that does not necessarily refer to an alias on the remote site.

So, there should be some way for drush to use drush @remoteserver site-alias @alias -pipe to remotely look up an alias when it is referenced, but I'm undecided on what configuration settings should cause that to happen. On the other hand, maybe #736686: Helper function to generate an alias record for the specified site: drush alias-add @aliasname is sufficient, and there is no need to fetch aliases remotely on demand.

greg.1.anderson’s picture

Status: Active » Closed (duplicate)

I'm going to say that #736686: Helper function to generate an alias record for the specified site: drush alias-add @aliasname is a better idea, and close this issue as a duplicate.