Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HAMMER] [V2V] Allow ssh auth for RHV #18800

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions app/models/conversion_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,15 @@ def connect_ssh
end

def miq_ssh_util_args
send("miq_ssh_util_args_#{resource.type.gsub('::', '_').downcase}")
end

def miq_ssh_util_args_manageiq_providers_redhat_inframanager_host
authentication = find_credentials
[hostname || ipaddress, authentication.userid, authentication.password, nil, nil]
end

def miq_ssh_util_args_manageiq_providers_openstack_cloudmanager_vm
authentication = find_credentials
[hostname || ipaddress, authentication.userid, nil, nil, nil, { :key_data => authentication.auth_key, :passwordless_sudo => true }]
case authentication.type
when 'AuthPrivateKey', 'AuthToken'
return [hostname || ipaddress, authentication.userid, nil, nil, nil, { :key_data => authentication.auth_key, :passwordless_sudo => true }]
when 'AuthUseridPassword'
return [hostname || ipaddress, authentication.userid, authentication.password, nil, nil]
else
raise "Unsupported authentication type: #{authentication.type}"
end
end

# Run the specified ansible playbook using the ansible-playbook command. The
Expand Down