How to call the "correct" callback from several callback files?, a.k.a. clear and simple playbook example

Hi All,

I am trying to get my head around of calling the correct “callback” file or // and class from multiple callbacks in the plugins/callbacks files.

More verbose explanation that if I write my own callback file (classes) and put it into the folder, how do I utilise it?
How do I make sure Ansible chooses the right one?

It seems like no examples or yml snippets in the docs.

I’ll be truly appreciated any (clear, simple) pointers and answers.

Best Regards: JohnP

You don’t call callback plugins, Ansible looks for callback plugins and calls them.

By default ansible looks in /usr/share/ansible_plugins/callback_plugins , see http://docs.ansible.com/intro_configuration.html#callback-plugins

Additionally it looks in the same directory as where your playbook resides in a directory called callback_plugins, such as:

/path/to/playbook.yml
/path/to/callback_plugins/somecallback.py

The plugins directory in github, is basically an “examples” directory, where you can grab some example plugins from. You don’t need to put anything in that dir, as ansible doesn’t look for anything in there.