foreman_remote_execution 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/concerns/foreman_remote_execution/host_extensions.rb +1 -1
- data/app/models/concerns/foreman_remote_execution/smart_proxy_extensions.rb +1 -1
- data/app/models/job_invocation_composer.rb +1 -1
- data/app/models/ssh_execution_provider.rb +10 -3
- data/app/services/default_proxy_proxy_selector.rb +1 -1
- data/app/services/remote_execution_proxy_selector.rb +7 -2
- data/db/seeds.d/60-ssh_proxy_feature.rb +3 -0
- data/lib/foreman_remote_execution/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71b09dd41d7ce39e709e4a45c2c78926d53151ed3625fcf2f4e0d739853cae8e
|
|
4
|
+
data.tar.gz: d01463507ceb52b52f661fa9a55ce413e2f824d74dfe50958063359f5a6fa8e9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2840a0f11ef02ba63f3a981075eae66e50e5fa0f7738518c3bf3a74f0bf5b7cf6be3273c2ebb999d00174244fb73295b3d0f8c74b663ef9839a91a16ad9c9878
|
|
7
|
+
data.tar.gz: 79a0dad8442b9135995a8bcbf62dfde4e112cd765950b61f45db0c490eac0d21e3cf843aea946c2450f69ab8f4d098fe26927b4eafe4cd0b7d6a1097ba04ceb9
|
|
@@ -102,7 +102,7 @@ module ForemanRemoteExecution
|
|
|
102
102
|
end
|
|
103
103
|
|
|
104
104
|
def remote_execution_ssh_keys
|
|
105
|
-
remote_execution_proxies(
|
|
105
|
+
remote_execution_proxies(%w(SSH Script), false).values.flatten.uniq.map { |proxy| proxy.pubkey }.compact.uniq
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def drop_execution_interface_cache
|
|
@@ -37,8 +37,7 @@ class ScriptExecutionProvider < RemoteExecutionProvider
|
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
def ssh_params(host)
|
|
40
|
-
|
|
41
|
-
proxy = proxy_selector.determine_proxy(host, 'SSH')
|
|
40
|
+
proxy = proxy_for_cockpit(host)
|
|
42
41
|
{
|
|
43
42
|
:hostname => find_ip_or_hostname(host),
|
|
44
43
|
:proxy => proxy.class == Symbol ? proxy : proxy.url,
|
|
@@ -54,7 +53,7 @@ class ScriptExecutionProvider < RemoteExecutionProvider
|
|
|
54
53
|
end
|
|
55
54
|
|
|
56
55
|
def proxy_feature
|
|
57
|
-
|
|
56
|
+
%w(SSH Script)
|
|
58
57
|
end
|
|
59
58
|
|
|
60
59
|
private
|
|
@@ -66,6 +65,14 @@ class ScriptExecutionProvider < RemoteExecutionProvider
|
|
|
66
65
|
def ssh_port(host)
|
|
67
66
|
Integer(host_setting(host, :remote_execution_ssh_port))
|
|
68
67
|
end
|
|
68
|
+
|
|
69
|
+
def proxy_for_cockpit(host)
|
|
70
|
+
proxy_selector = ::RemoteExecutionProxySelector.new
|
|
71
|
+
proxy = proxy_selector.determine_proxy(host, 'Script', capability: 'cockpit')
|
|
72
|
+
return proxy unless [:not_defined, :not_available, nil].include?(proxy)
|
|
73
|
+
|
|
74
|
+
proxy_selector.determine_proxy(host, 'SSH')
|
|
75
|
+
end
|
|
69
76
|
end
|
|
70
77
|
end
|
|
71
78
|
|
|
@@ -7,7 +7,7 @@ class DefaultProxyProxySelector < ::RemoteExecutionProxySelector
|
|
|
7
7
|
super
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def available_proxies(host, provider)
|
|
10
|
+
def available_proxies(host, provider, capability: nil)
|
|
11
11
|
# TODO: Once we have a internal proxy marker/feature on the proxy, we can
|
|
12
12
|
# swap the implementation
|
|
13
13
|
raise _('default_capsule method missing from SmartProxy') unless ::SmartProxy.respond_to?(:default_capsule)
|
|
@@ -2,7 +2,12 @@ class RemoteExecutionProxySelector < ::ForemanTasks::ProxySelector
|
|
|
2
2
|
|
|
3
3
|
INTERNAL_PROXY = 'internal'.freeze
|
|
4
4
|
|
|
5
|
-
def available_proxies(host, provider)
|
|
6
|
-
host.remote_execution_proxies(provider)
|
|
5
|
+
def available_proxies(host, provider, capability: nil)
|
|
6
|
+
proxies = host.remote_execution_proxies(provider)
|
|
7
|
+
return proxies if capability.nil?
|
|
8
|
+
|
|
9
|
+
proxies.reduce({}) do |acc, (strategy, possible_proxies)|
|
|
10
|
+
acc.merge(strategy => possible_proxies.select { |proxy| proxy.has_capability?(capability) })
|
|
11
|
+
end
|
|
7
12
|
end
|
|
8
13
|
end
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
f = Feature.where(:name => 'SSH').first_or_create
|
|
2
2
|
raise "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
|
|
3
|
+
|
|
4
|
+
f = Feature.where(:name => 'Script').first_or_create
|
|
5
|
+
raise "Unable to create proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foreman_remote_execution
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.
|
|
4
|
+
version: 6.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Foreman Remote Execution team
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-04-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: deface
|
|
@@ -545,7 +545,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
545
545
|
- !ruby/object:Gem::Version
|
|
546
546
|
version: '0'
|
|
547
547
|
requirements: []
|
|
548
|
-
rubygems_version: 3.
|
|
548
|
+
rubygems_version: 3.1.4
|
|
549
549
|
signing_key:
|
|
550
550
|
specification_version: 4
|
|
551
551
|
summary: A plugin bringing remote execution to the Foreman, completing the config
|