# Missing somthing with callbacks use (callbacks are included but not ran)

**URL:** <https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760>\
**Category:** Ansible Developer\
**Created:** [November 12, 2014, 4:55pm UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760 "2014-11-12T16:55:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Laredo](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@Tom\_Laredo](https://forum.ansible.com/u/Tom_Laredo)\
**Post date:** [November 12, 2014, 4:55pm UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/1 "2014-11-12T16:55:52Z")

</div>

Hi,

I’m new to Ansible and I’m trying to write a callback for storing results of my playbooks in a database.  
My problem is that I don’t manage to make my callbacks ran by Ansible.

Here is a part of my /etc/ansible/ansible.cfg file:

`[...] callback_plugins = /usr/share/ansible_plugins/callback_plugins load_callback_plugins = True`

As you can see, according to [PR #8911](https://github.com/ansible/ansible/pull/8911), I set the `load_callback_plugins `variable to True but that didn’t fix my issue.  
In /usr/share/ansible\_plugins/callback\_plugins I have two .py callback files (mail.py – the famous one – and a custom callback) but none of them seems to be ran.

What have I missed?

Best regards,  
Tom

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 12, 2014, 9:15pm UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/2 "2014-11-12T21:15:15Z")

</div>

Are you running ‘ansible’ or ‘ansible-playbook’? Only ansible-playbook picks up plugins, unless you set

bin\_ansible\_callbacks = True

in your ansible.cfg

Be aware that different events are fired when running ‘ansible’ so you’d have to code your plugin to react to them.

Jon

---

<div class="post-metadata">

**Author:** ![Tom\_Laredo](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@Tom\_Laredo](https://forum.ansible.com/u/Tom_Laredo)\
**Post date:** [November 13, 2014, 8:03am UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/3 "2014-11-13T08:03:28Z")

</div>

Thank you for your reply but I’m actually running ansible-playbook (with ansible 1.7.2).

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 13, 2014, 9:15am UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/4 "2014-11-13T09:15:40Z")

</div>

In that case… are you certain the ansible.cfg you have created is being picked up?  
I copied mine to /etc/ansible if I recall  
Jon

---

<div class="post-metadata">

**Author:** ![Tom\_Laredo](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@Tom\_Laredo](https://forum.ansible.com/u/Tom_Laredo)\
**Post date:** [November 13, 2014, 10:09am UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/5 "2014-11-13T10:09:25Z")

</div>

I’m using the built-in /etc/ansible/ansible.cfg file provided by the Debian Package.  
I’m certain that it is picked up because I turned the logging on and it worked.  
Have the callback files to be executable or just readable (as it is by now)?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [November 13, 2014, 10:57am UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/6 "2014-11-13T10:57:23Z")

</div>

Neither of my plugins are set to be executable, but I am running from a git checkout at the moment.

The mail plugin only seems to be interested in failure events so perhaps it is not getting fired?

I’d try creating the simplest possible plugin just to see if it is getting triggered, something like the following (not tested!):

`

# testplugin.py

import os

class CallbackModule(object):

“”"  
This trivial callback module does nothing useful, just prints a message when it is initialized.  
“”"  
def **init** (self):  
print “custom plugin is active.”

#end of plugin

`

---

<div class="post-metadata">

**Author:** ![Tom\_Laredo](https://avatars.discourse-cdn.com/v4/letter/t/ecc23a/32.png) [@Tom\_Laredo](https://forum.ansible.com/u/Tom_Laredo)\
**Post date:** [November 13, 2014, 2:05pm UTC](https://forum.ansible.com/t/missing-somthing-with-callbacks-use-callbacks-are-included-but-not-ran/16760/7 "2014-11-13T14:05:40Z")

</div>

And that was the good test to do: “custom plugin is active.” is well printed when I run my ansible-playbook command.  
So my callbacks are executed, my issue is somewhere else. I will re-read the mail.py callback to understand what could be my issue.  
Thank you very much for your guidelines 🙂
