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

46 views
Skip to first unread message

JohnP

unread,
May 19, 2014, 12:08:09 PM5/19/14
to ansible...@googlegroups.com
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


Matt Martz

unread,
May 19, 2014, 8:48:25 PM5/19/14
to ansible...@googlegroups.com, 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.
-- 
Matt Martz
ma...@sivel.net
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5a23fadd-4a93-42bd-92ab-f7dc4d0ea3b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages