foreman_ansible 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 275aa3a16113e61a5eaf4fdaf6dddb0db8ebd40f
4
- data.tar.gz: 2926a08f5acb7551b2945bb1662bddd57151daeb
3
+ metadata.gz: 832a0aa23787c1f390fab13d3ecc3e58a60c6af6
4
+ data.tar.gz: 3ca0fcc13b040e9e36fb7a7d2b3ff9c4344d8b12
5
5
  SHA512:
6
- metadata.gz: cd4524fc8bb4059abe867a4beea2c62e51e07560792fccbaa5e653ff4f09750451b36a3d5ab314ec873ab55853917302331e18a9c5bc8272653d1cfea3f69eb7
7
- data.tar.gz: 746ea0fc1a44d761d323ab2077b0743169e88f00f4f338e50d8efeb4882ce3b7d9f1d6a76d0a9d913d325a26f0f64935031d3b6833419360f98e7cdcb3395b4c
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
- ::ForemanAnsible::InventoryCreator.new([host]).to_hash.to_json
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
 
@@ -2,5 +2,5 @@
2
2
  # This way other parts of Foreman can just call ForemanAnsible::VERSION
3
3
  # and detect what version the plugin is running.
4
4
  module ForemanAnsible
5
- VERSION = '2.0.3'.freeze
5
+ VERSION = '2.0.4'.freeze
6
6
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia