show changed in online
This commit is contained in:
parent
5a333859fe
commit
32cf79c044
1 changed files with 12 additions and 4 deletions
|
@ -56,11 +56,19 @@ class CallbackModule(CallbackBase):
|
||||||
color=C.COLOR_ERROR)
|
color=C.COLOR_ERROR)
|
||||||
|
|
||||||
def v2_runner_on_ok(self, result):
|
def v2_runner_on_ok(self, result):
|
||||||
if result._task.action in C.MODULE_NO_JSON:
|
|
||||||
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, 'SUCCESS'), color=C.COLOR_OK)
|
if result._result.get('changed', False):
|
||||||
|
color = C.COLOR_CHANGED
|
||||||
|
state = 'CHANGED'
|
||||||
else:
|
else:
|
||||||
self._display.display("%s | SUCCESS => %s" % (result._host.get_name(), self._dump_results(result._result, indent=0).replace('\n', '')),
|
color = C.COLOR_OK
|
||||||
color=C.COLOR_OK)
|
state = 'SUCCESS'
|
||||||
|
|
||||||
|
if result._task.action in C.MODULE_NO_JSON:
|
||||||
|
self._display.display(self._command_generic_msg(result._host.get_name(), result._result, state), color=color)
|
||||||
|
else:
|
||||||
|
self._display.display("%s | %s => %s" % (result._host.get_name(), state, self._dump_results(result._result, indent=0).replace('\n', '')),
|
||||||
|
color=color)
|
||||||
|
|
||||||
def v2_runner_on_unreachable(self, result):
|
def v2_runner_on_unreachable(self, result):
|
||||||
self._display.display("%s | UNREACHABLE!: %s" % (result._host.get_name(), result._result.get('msg', '')), color=C.COLOR_UNREACHABLE)
|
self._display.display("%s | UNREACHABLE!: %s" % (result._host.get_name(), result._result.get('msg', '')), color=C.COLOR_UNREACHABLE)
|
||||||
|
|
Loading…
Reference in a new issue