|
|
|
@ -63,22 +63,14 @@ class CallbackModule(CallbackBase):
|
|
|
|
|
if result._task.action == 'include':
|
|
|
|
|
return
|
|
|
|
|
elif result._result.get('changed', False):
|
|
|
|
|
if result._task.delegate_to is not None or result._task._local_action:
|
|
|
|
|
if result._task._local_action:
|
|
|
|
|
target = 'localhost'
|
|
|
|
|
else:
|
|
|
|
|
target = result._task.delegate_to
|
|
|
|
|
msg = "changed: [%s -> %s]" % (result._host.get_name(), target)
|
|
|
|
|
if result._task.delegate_to is not None:
|
|
|
|
|
msg = "changed: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to)
|
|
|
|
|
else:
|
|
|
|
|
msg = "changed: [%s]" % result._host.get_name()
|
|
|
|
|
color = 'yellow'
|
|
|
|
|
else:
|
|
|
|
|
if result._task.delegate_to is not None or result._task._local_action:
|
|
|
|
|
if result._task._local_action:
|
|
|
|
|
target = 'localhost'
|
|
|
|
|
else:
|
|
|
|
|
target = result._task.delegate_to
|
|
|
|
|
msg = "ok: [%s -> %s]" % (result._host.get_name(), target)
|
|
|
|
|
if result._task.delegate_to is not None:
|
|
|
|
|
msg = "ok: [%s -> %s]" % (result._host.get_name(), result._task.delegate_to)
|
|
|
|
|
else:
|
|
|
|
|
msg = "ok: [%s]" % result._host.get_name()
|
|
|
|
|
color = 'green'
|
|
|
|
@ -104,12 +96,8 @@ class CallbackModule(CallbackBase):
|
|
|
|
|
self._display.display(msg, color='cyan')
|
|
|
|
|
|
|
|
|
|
def v2_runner_on_unreachable(self, result):
|
|
|
|
|
if result._task.delegate_to or result._task._local_action:
|
|
|
|
|
if result._task._local_action:
|
|
|
|
|
target = 'localhost'
|
|
|
|
|
else:
|
|
|
|
|
target = result._task.delegate_to
|
|
|
|
|
self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), target, self._dump_results(result._result)), color='red')
|
|
|
|
|
if result._task.delegate_to:
|
|
|
|
|
self._display.display("fatal: [%s -> %s]: UNREACHABLE! => %s" % (result._host.get_name(), result._task.delegate_to, self._dump_results(result._result)), color='red')
|
|
|
|
|
else:
|
|
|
|
|
self._display.display("fatal: [%s]: UNREACHABLE! => %s" % (result._host.get_name(), self._dump_results(result._result)), color='red')
|
|
|
|
|
|
|
|
|
|