Handle unreachable

We forgot to handle unreachable errors.

fatal: [compute-1]: UNREACHABLE! => {"changed": false, "msg": "Failed to
connect to the host via ssh: ssh: connect to host 192.168.24.18 port 22:
No route to host", "unreachable": true}

Change-Id: I55f078be5fbdd762ffb63fb25ca6a192abb2e049
This commit is contained in:
Alex Schultz 2020-06-11 15:42:03 -06:00
parent c15a7ce013
commit ffe694808e
1 changed files with 13 additions and 0 deletions

View File

@ -253,6 +253,19 @@ class CallbackModule(DefaultCallback):
line.append('item=%s' % item_result)
self._output(line, color)
def v2_runner_on_unreachable(self, result):
line = [
self._get_uuid(result),
self._get_state('UNREACHABLE'),
self._get_task_name(result),
self._get_host(result=result)
]
item_result = self._get_item_label(result._result)
# don't display if None
if item_result:
line.append('item=%s' % item_result)
self._output(line, C.COLOR_UNREACHABLE)
def v2_playbook_on_include(self, included_file):
color = C.COLOR_SKIP
# included files don't have tasks so lets generate one for the file