Allow cloud roster to use sudo

Similar to issue #26689, but I am using the cloud roster file to get the IP targets generated from running salt-cloud.
This commit is contained in:
Kevin King 2015-09-25 01:33:31 -07:00 committed by rallytime
parent d76a77c911
commit b4334649d5

View file

@ -99,6 +99,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