foreman_ansible 2.0.3 → 2.0.4
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 832a0aa23787c1f390fab13d3ecc3e58a60c6af6
|
4
|
+
data.tar.gz: 3ca0fcc13b040e9e36fb7a7d2b3ff9c4344d8b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73c63a710e5d0de08464f4a4e24fe65d782294b6f1eee55978235eb1df0d35378ad9336c919fe44d0e8c13849c610620d3a357352a51e6f770aa56d557f2ef98
|
7
|
+
data.tar.gz: 728a72b85aeda5be356c6c442b523fd36ffb0775a3a090dc83cd3623bd3145569f0fc6aa8aa136d937cba3b274832c0ebadcf5fe4fbf6df8dc7f09603d5c4f20
|
@@ -18,8 +18,9 @@ if defined? ForemanRemoteExecution
|
|
18
18
|
|
19
19
|
def proxy_command_options(template_invocation, host)
|
20
20
|
super(template_invocation, host).merge(
|
21
|
-
'ansible_inventory' =>
|
22
|
-
|
21
|
+
'ansible_inventory' => ::ForemanAnsible::InventoryCreator.new(
|
22
|
+
[host], template_invocation
|
23
|
+
).to_hash.to_json
|
23
24
|
)
|
24
25
|
end
|
25
26
|
end
|
@@ -6,8 +6,9 @@ module ForemanAnsible
|
|
6
6
|
class InventoryCreator
|
7
7
|
attr_reader :hosts
|
8
8
|
|
9
|
-
def initialize(hosts)
|
9
|
+
def initialize(hosts, template_invocation)
|
10
10
|
@hosts = hosts
|
11
|
+
@template_invocation = template_invocation
|
11
12
|
end
|
12
13
|
|
13
14
|
# It returns a hash in a format that Ansible understands.
|
@@ -21,7 +22,8 @@ module ForemanAnsible
|
|
21
22
|
hosts = @hosts.map do |h|
|
22
23
|
RemoteExecutionProvider.find_ip_or_hostname(h)
|
23
24
|
end
|
24
|
-
{ 'all' => { 'hosts' => hosts
|
25
|
+
{ 'all' => { 'hosts' => hosts,
|
26
|
+
'vars' => template_inputs(@template_invocation) },
|
25
27
|
'_meta' => { 'hostvars' => hosts_vars } }
|
26
28
|
end
|
27
29
|
|
data/test/test_plugin_helper.rb
CHANGED
@@ -23,5 +23,7 @@ def assert_job_invocation_is_ok(response, targets)
|
|
23
23
|
assert_response :created
|
24
24
|
end
|
25
25
|
plugin_factories_path = File.join(File.dirname(__FILE__), 'factories')
|
26
|
+
rex_factories_path = "#{ForemanRemoteExecution::Engine.root}/test/factories"
|
27
|
+
FactoryBot.definition_file_paths << rex_factories_path
|
26
28
|
FactoryBot.definition_file_paths << plugin_factories_path
|
27
29
|
FactoryBot.reload
|
@@ -25,7 +25,6 @@ module ForemanAnsible
|
|
25
25
|
@host.expects(:host_params).returns(extra_options).at_least_once
|
26
26
|
inventory = ForemanAnsible::InventoryCreator.new(@host,
|
27
27
|
@template_invocation)
|
28
|
-
|
29
28
|
assert_empty extra_options.to_a - inventory.connection_params(@host).to_a
|
30
29
|
end
|
31
30
|
|