mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
fixed ability to pass ssh key to Linux VMs
This commit is contained in:
parent
4a141a103d
commit
a1a61ee8b0
1 changed files with 12 additions and 11 deletions
|
@ -852,7 +852,7 @@ def create_network_interface(call=None, kwargs=None):
|
|||
]
|
||||
break
|
||||
except CloudError as exc:
|
||||
log.error('There was a cloud error: %s', exc)
|
||||
log.error('There was a cloud error: {0}'.format(exc))
|
||||
count += 1
|
||||
if count > 120:
|
||||
raise ValueError('Timed out waiting for public IP Address.')
|
||||
|
@ -1035,15 +1035,6 @@ def request_instance(vm_):
|
|||
default=False
|
||||
)
|
||||
|
||||
vm_password = salt.utils.stringutils.to_str(
|
||||
config.get_cloud_config_value(
|
||||
'ssh_password', vm_, __opts__, search_global=True,
|
||||
default=config.get_cloud_config_value(
|
||||
'win_password', vm_, __opts__, search_global=True
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
os_kwargs = {}
|
||||
win_installer = config.get_cloud_config_value(
|
||||
'win_installer', vm_, __opts__, search_global=True
|
||||
|
@ -1061,6 +1052,16 @@ def request_instance(vm_):
|
|||
ssh=sshconfiguration,
|
||||
)
|
||||
os_kwargs['linux_configuration'] = linuxconfiguration
|
||||
vm_password = None
|
||||
else:
|
||||
vm_password = salt.utils.stringutils.to_str(
|
||||
config.get_cloud_config_value(
|
||||
'ssh_password', vm_, __opts__, search_global=True,
|
||||
default=config.get_cloud_config_value(
|
||||
'win_password', vm_, __opts__, search_global=True
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if win_installer or (vm_password is not None and not disable_password_authentication):
|
||||
if not isinstance(vm_password, str):
|
||||
|
@ -1327,7 +1328,7 @@ def request_instance(vm_):
|
|||
),
|
||||
network_profile=NetworkProfile(
|
||||
network_interfaces=[
|
||||
NetworkInterfaceReference(vm_['iface_id']),
|
||||
NetworkInterfaceReference(id=vm_['iface_id']),
|
||||
],
|
||||
),
|
||||
availability_set=availability_set,
|
||||
|
|
Loading…
Add table
Reference in a new issue