foreman_ansible_core 2.2.0 → 2.2.1

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: e195d6690093de003b7ddaf9b807ac0d79ad775a
4
- data.tar.gz: 4286d8f97ffca80c17be58c302fb2aeffbf1d02f
3
+ metadata.gz: ec7cac54f7db525000849608439276fd87cb5c18
4
+ data.tar.gz: fb7033e1fbfc751b6ba4b0a54f0c7da9047302e1
5
5
  SHA512:
6
- metadata.gz: b1555fd4cb45577b25aa1f6b6ff4ba0ac02d354fa3c74e33790dc63e3454de9d70c1a01b4cc929b1096437395dfbdbb519e82e22f333710da2a5b5cf0d12331b
7
- data.tar.gz: 23e7b36347e64370135f75e18165d424ba6ee7bc429335be4e83a1778e05d6fd17c38c2ba1f76e8a0515cd424b4cf644c0b7995b876aa3f4055e4ccb5bcaf53c
6
+ metadata.gz: 19ad3f4950508999a31d3b8cb969bf6e60246763ef15a2a401b31c2adddfe0aae8900e2f9ef303a17fbf4e1b387c2a38187d34ffbdac89c03bddba669c5c4269
7
+ data.tar.gz: 3f5a68bc74b91eb32fdc146a4191daf9d40d35fbca1cbc582ecd56dc9cf4d898254cfa888e6872383cc007d409f6c13cfdab1527dc684156a899b5119b2d6da5
@@ -5,6 +5,7 @@ module ForemanAnsibleCore
5
5
  # Takes an inventory and runs it through REXCore CommandRunner
6
6
  class AnsibleRunner < ::ForemanTasksCore::Runner::CommandRunner
7
7
  DEFAULT_REFRESH_INTERVAL = 1
8
+ CONNECTION_PROMPT = 'Are you sure you want to continue connecting (yes/no)? '
8
9
 
9
10
  def initialize(options)
10
11
  super(options)
@@ -39,6 +40,21 @@ module ForemanAnsibleCore
39
40
  @command_in = @playbook_runner.command_in
40
41
  @command_pid = @playbook_runner.command_pid
41
42
  super
43
+ kill if unknown_host_key_fingerprint?
44
+ end
45
+
46
+ def kill
47
+ publish_exit_status(1)
48
+ ::Process.kill('SIGTERM', @command_pid)
49
+ close
50
+ end
51
+
52
+ private
53
+
54
+ def unknown_host_key_fingerprint?
55
+ last_output = @continuous_output.raw_outputs.last
56
+ return if last_output.nil?
57
+ last_output['output']&.lines&.last == CONNECTION_PROMPT
42
58
  end
43
59
  end
44
60
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanAnsibleCore
4
- VERSION = '2.2.0'
4
+ VERSION = '2.2.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_ansible_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-22 00:00:00.000000000 Z
11
+ date: 2019-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop