from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.callback import CallbackBase from ansible import constants as C from ansible.utils.color import colorize, hostcolor from ansible.utils.display import Display class CallbackModule(CallbackBase): CALLBACK_VERSION = 2.0 CALLBACK_TYPE = 'notification' CALLBACK_NAME = 'hello_bob' def __init__(self, *args, **kwargs): super(CallbackModule, self).__init__() def v2_on_any(self, *args, **kwargs): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_failed(self, result, ignore_errors=False): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_ok(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_skipped(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_unreachable(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_async_poll(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_async_ok(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_async_failed(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_start(self, playbook): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_notify(self, handler, host): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_no_hosts_matched(self): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_no_hosts_remaining(self): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_task_start(self, task, is_conditional): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_cleanup_task_start(self, task): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_handler_task_start(self, task): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_vars_prompt(self, varname, private=True, prompt=None, encrypt=None, confirm=False, salt_size=None, salt=None, default=None, unsafe=None): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_import_for_host(self, result, imported_file): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_not_import_for_host(self, result, missing_file): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_play_start(self, play): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_stats(self, stats): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_on_file_diff(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_playbook_on_include(self, included_file): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_item_on_ok(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_item_on_failed(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_item_on_skipped(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_retry(self, result): self._display.display("Custom commands for go here", color=C.COLOR_OK) def v2_runner_on_start(self, host, task): self._display.display("Custom commands for go here", color=C.COLOR_OK)