smart_proxy_ansible 3.5.2 → 3.5.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
  SHA256:
3
- metadata.gz: 7b5d2745c11496676bc9a45ae0ff6d79bb30fa5e9c999928ceea7c6a41861d0a
4
- data.tar.gz: 3b5148e6164430a508661254056631ae82e1c7b69680c59fb7efa1e6ff8bc531
3
+ metadata.gz: aeca31386ddf249d6cbce37e14bac2be1217132e9d7700595d1a98bfce4f9edb
4
+ data.tar.gz: d46c8e35fe05c3d2808226eda74a14b26cf77a5bfcc66f494d6e680f21893173
5
5
  SHA512:
6
- metadata.gz: 5d60cb3dce9bc1dc1b6785431f99a1020eb61b6e8661591ccbc505f9a13e24958998b5d231dc6e881e541e69af910c793f4b9d19c49f037887bf22632865071f
7
- data.tar.gz: 12f655b663252af5aeaab23bd5af509a73f6a3c0f9b09cb3c403fd995859e740bea4ceedbef52fedacffc48ea82a2919db146accf9160f0b342dc0bc946bdab0
6
+ metadata.gz: a64fc645a04b2348cb94e9975a059ff72d053de4c0f95d256f10c2219eb68f691fb0abdcb1d08d2893467cd607ab49cd474a1f1c633718c8ef6c46c256c2a6ca
7
+ data.tar.gz: e093cc229af6dffb46ead2c4d7118d53e87d3a78ab67d1d5256130b95ae95b9beccb89186d95365e789abcbc99df67d661b1cc4a6d90dd4e90ffa3ec571b24bc
@@ -68,7 +68,7 @@ module Proxy::Ansible
68
68
  def publish_exit_status(status)
69
69
  process_artifacts
70
70
  super
71
- @targets.each_key { |host| publish_exit_status_for(host, status) } if status != 0
71
+ @targets.each_key { |host| publish_exit_status_for(host, @exit_statuses[host]) } if status != 0
72
72
  end
73
73
 
74
74
  def initialize_command(*command)
@@ -143,19 +143,27 @@ module Proxy::Ansible
143
143
  if event['event'] == 'playbook_on_stats'
144
144
  failures = event.dig('event_data', 'failures') || {}
145
145
  unreachable = event.dig('event_data', 'dark') || {}
146
+ rescued = event.dig('event_data', 'rescued') || {}
146
147
  header, *rows = event['stdout'].strip.lines.map(&:chomp)
147
148
  @outputs.keys.select { |key| key.is_a? String }.each do |host|
148
149
  line = rows.find { |row| row =~ /#{host}/ }
149
150
  publish_data_for(host, [header, line].join("\n"), 'stdout')
150
151
 
151
152
  # If the task has been rescued, it won't consider a failure
152
- if @exit_statuses[host].to_i != 0 && failures[host].to_i <= 0 && unreachable[host].to_i <= 0
153
+ if @exit_statuses[host].to_i != 0 && failures[host].to_i <= 0 && unreachable[host].to_i <= 0 && rescued[host].to_i > 0
153
154
  publish_exit_status_for(host, 0)
154
155
  end
155
156
  end
156
157
  else
157
158
  broadcast_data(event['stdout'] + "\n", 'stdout')
158
159
  end
160
+
161
+ # If the run ends early due to an error - fail all other tasks
162
+ if event['event'] == 'error'
163
+ @outputs.keys.select { |key| key.is_a? String }.each do |host|
164
+ @exit_statuses[host] = 4 if @exit_statuses[host].to_i == 0
165
+ end
166
+ end
159
167
  end
160
168
 
161
169
  def write_inventory
@@ -2,6 +2,6 @@ module Proxy
2
2
  # Version, this allows the proxy and other plugins know
3
3
  # what version of the Ansible plugin is running
4
4
  module Ansible
5
- VERSION = '3.5.2'
5
+ VERSION = '3.5.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_ansible
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-27 00:00:00.000000000 Z
12
+ date: 2023-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake