mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 20:01:25 -07:00
default: callback plugin allow unreachable task to stderr (#50533)
Provide toggle flag to allow display of unreachable task to stderr using default callback plugin. Fixes: #48069 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
636e1d5fcb
commit
17bb4f4932
6 changed files with 39 additions and 6 deletions
|
@ -158,11 +158,10 @@ class CallbackModule(CallbackBase):
|
|||
|
||||
delegated_vars = result._result.get('_ansible_delegated_vars', None)
|
||||
if delegated_vars:
|
||||
self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), delegated_vars['ansible_host'],
|
||||
self._dump_results(result._result)),
|
||||
color=C.COLOR_UNREACHABLE)
|
||||
msg = "fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), delegated_vars['ansible_host'], self._dump_results(result._result))
|
||||
else:
|
||||
self._display.display("fatal: [%s]: UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result)), color=C.COLOR_UNREACHABLE)
|
||||
msg = "fatal: [%s]: UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result))
|
||||
self._display.display(msg, color=C.COLOR_UNREACHABLE, stderr=self.display_failed_stderr)
|
||||
|
||||
def v2_playbook_on_no_hosts_matched(self):
|
||||
self._display.display("skipping: no hosts matched", color=C.COLOR_SKIP)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue