updates-dashboard-front/ansible/hooks/update_dashboard.py
2022-08-17 16:33:32 +02:00

24 lines
702 B
Python

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'stdout'
CALLBACK_NAME = 'update_dashboard'
def v2_runner_on_ok(self, result):
if result._task.action == 'debug':
ansible_msg = result._result.get('msg', None)
if ansible_msg:
print(ansible_msg)
def v2_runner_on_unreachable(self, result):
print("%s;UNREACHABLE" % result._host.get_name())
def v2_runner_on_failed(self, result, ignore_errors=False):
print("%s;FAILED" % result._host.get_name())