Class: SSHExecutionProvider
Constant Summary
collapse
- EFFECTIVE_USER_METHODS =
%w[sudo su].freeze
Class Method Summary
collapse
provider_for, provider_names, providers, register
Class Method Details
.find_ip_or_hostname(host) ⇒ Object
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'app/models/ssh_execution_provider.rb', line 21
def find_ip_or_hostname(host)
interfaces = effective_interfaces(host)
if host_setting(host, :remote_execution_connect_by_ip)
ip_interface = interfaces.find { |i| i.ip.present? }
end
if ip_interface
ip_interface.ip
else
fqdn_interface = interfaces.find { |i| i.fqdn.present? }
if fqdn_interface
fqdn_interface.fqdn
else
raise _('Could not find any suitable interface for execution')
end
end
end
|
.humanized_name ⇒ Object
13
14
15
|
# File 'app/models/ssh_execution_provider.rb', line 13
def humanized_name
_('SSH')
end
|
.proxy_command_options(template_invocation, host) ⇒ Object
6
7
8
9
10
11
|
# File 'app/models/ssh_execution_provider.rb', line 6
def proxy_command_options(template_invocation, host)
super.merge(:ssh_user => ssh_user(host),
:effective_user => effective_user(template_invocation),
:effective_user_method => effective_user_method(host),
:ssh_port => ssh_port(host))
end
|
.supports_effective_user? ⇒ Boolean
17
18
19
|
# File 'app/models/ssh_execution_provider.rb', line 17
def supports_effective_user?
true
end
|