Make `ignore_unreachable` to count `ignored` counter

Fixes #77690
pull/77948/head
Kristian Heljas 3 years ago committed by GitHub
parent e6075109d0
commit 9767cda507
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,4 @@
breaking_changes:
- >-
strategy plugins - Make ``ignore_unreachable`` to increase ``ignored`` and ``ok`` and counter,
not ``skipped`` and ``unreachable``. (https://github.com/ansible/ansible/issues/77690)

@ -130,6 +130,9 @@ class CallbackModule(CallbackBase):
msg = "fatal: [%s]: UNREACHABLE! => %s" % (host_label, self._dump_results(result._result))
self._display.display(msg, color=C.COLOR_UNREACHABLE, stderr=self.get_option('display_failed_stderr'))
if result._task.ignore_unreachable:
self._display.display("...ignoring", color=C.COLOR_SKIP)
def v2_playbook_on_no_hosts_matched(self):
self._display.display("skipping: no hosts matched", color=C.COLOR_SKIP)

@ -631,10 +631,10 @@ class StrategyBase:
if not ignore_unreachable:
self._tqm._unreachable_hosts[original_host.name] = True
iterator._play._removed_hosts.append(original_host.name)
else:
self._tqm._stats.increment('skipped', original_host.name)
task_result._result['skip_reason'] = 'Host %s is unreachable' % original_host.name
self._tqm._stats.increment('dark', original_host.name)
else:
self._tqm._stats.increment('ok', original_host.name)
self._tqm._stats.increment('ignored', original_host.name)
self._tqm.send_callback('v2_runner_on_unreachable', task_result)
elif task_result.is_skipped():
self._tqm._stats.increment('skipped', original_host.name)

Loading…
Cancel
Save