Module: ForemanAzure::Concerns::SSHProvisionExtensions

Extended by:
ActiveSupport::Concern
Defined in:
app/models/foreman_azure/concerns/ssh_provision_extensions.rb

Instance Method Summary collapse

Instance Method Details

#setSSHWaitForResponse_with_use_ssh_keysObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/foreman_azure/concerns/ssh_provision_extensions.rb', line 10

def setSSHWaitForResponse_with_use_ssh_keys
  if compute_resource.type == "ForemanAzure::Azure"
    self.client = Foreman::Provision::SSH.new(
      provision_ip,
      image.username,
      { :template => template_file.path,
        :uuid => uuid,
        :keys => [compute_resource.certificate_path] })
  else
    setSSHWaitForResponse_without_use_ssh_keys
  end
rescue => e
  failure _("Failed to login via SSH to %{name}: %{e}") %
    { :name => name, :e => e }, e
end