Browse Source

Make callback plugin an always-on aggregate plugin

This makes it so that one doesn't need to explicitly enable nor replace
the default callback plugin.
Rodolfo Carvalho 8 years ago
parent
commit
80e824c00c
2 changed files with 6 additions and 7 deletions
  1. 0 1
      ansible.cfg.example
  2. 6 6
      callback_plugins/default_plus_summary.py

+ 0 - 1
ansible.cfg.example

@@ -15,7 +15,6 @@ log_path = /tmp/ansible.log
 
 # prints a descriptive summary of failed tasks
 callback_plugins = ./callback_plugins
-stdout_callback = default_plus_summary
 
 # Uncomment to use the provided BYO inventory
 #hostfile = inventory/byo/hosts

+ 6 - 6
callback_plugins/default_plus_summary.py

@@ -3,20 +3,20 @@
 Ansible callback plugin.
 '''
 
-from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
+from ansible.plugins.callback import CallbackBase
 from ansible import constants as C
 from ansible.utils.color import stringc
 
 
-class CallbackModule(CallbackModule_default):
+class CallbackModule(CallbackBase):
     '''
-    This is like the default callback plugin, but also stores results and
-    summarizes failures.
+    This callback plugin stores task results and summarizes failures.
     '''
 
     CALLBACK_VERSION = 2.0
-    CALLBACK_TYPE = 'stdout'
-    CALLBACK_NAME = 'default_plus_summary'
+    CALLBACK_TYPE = 'aggregate'
+    CALLBACK_NAME = 'failure_summary'
+    CALLBACK_NEEDS_WHITELIST = False
 
     def __init__(self):
         super(CallbackModule, self).__init__()