Merge pull request #27428 from rallytime/bp-27398

Back-port #27398 to 2015.8
This commit is contained in:
Mike Place 2015-09-28 09:03:16 -06:00
commit d4d96bb3fc

View file

@ -8,6 +8,13 @@ maintains an index of minions that it creates and deletes. This index tracks the
provider and profile configuration used to provision the minion, including
authentication information. So long as this configuration remains current, it can
be used by Salt SSH to log into any minion in the index.
To connect as a user other than root, modify the cloud configuration file
usually located at /etc/salt/cloud. For example, add the following:
.. code-block:: yaml
ssh_username: my_user
sudo: True
'''
# Import python libs
@ -100,6 +107,12 @@ def targets(tgt, tgt_type='glob', **kwargs): # pylint: disable=W0613
if key_filename:
ret['tgt']['priv'] = key_filename
sudo = salt.config.get_cloud_config_value(
'sudo', vm_, cloud_opts, search_global=False, default=None
)
if sudo:
ret['tgt']['sudo'] = sudo
return ret