# ansible foreman callback plugin

**URL:** <https://forum.ansible.com/t/ansible-foreman-callback-plugin/33572>\
**Category:** Ansible Project\
**Created:** [August 10, 2020, 12:55am UTC](https://forum.ansible.com/t/ansible-foreman-callback-plugin/33572 "2020-08-10T00:55:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kiran\_Kumar](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kiran\_Kumar](https://forum.ansible.com/u/Kiran_Kumar)\
**Post date:** [August 10, 2020, 12:55am UTC](https://forum.ansible.com/t/ansible-foreman-callback-plugin/33572/1 "2020-08-10T00:55:48Z")

</div>

Hi

I have setup the plugin for forman

[https://raw.githubusercontent.com/theforeman/foreman\_ansible/master/extras/foreman\_callback.py](https://raw.githubusercontent.com/theforeman/foreman_ansible/master/extras/foreman_callback.py)

Also install below on ansible control node

yum install -y python-pip  
pip install requests

the plugin file is updated

from **future** import absolute\_import

FOREMAN\_URL = os.getenv(‘FOREMAN\_URL’, “[https://xxx](https://xxx)”)

# Substitute by a real SSL certificate and key if your Foreman uses HTTPS

FOREMAN\_SSL\_CERT = (os.getenv(‘FOREMAN\_SSL\_CERT’, “/etc/foreman-proxy/ssl\_cert.pem”),  
os.getenv(‘FOREMAN\_SSL\_KEY’, “/etc/foreman-proxy/ssl\_key.pem”))

Ansible side is updated

[callback\_foreman]

url = [https://xx](https://xx)

ssl\_cert = /etc/foreman-proxy/ssl\_cert.pem  
ssl\_key = /etc/foreman-proxy/ssl\_key.pem  
verify\_certs = /etc/foreman-proxy/ssl\_ca.pem  
callback\_whitelist = foreman  
bin\_ansible\_callbacks = True  
callback\_plugins = /usr/share/ansible/plugins/callback  
stdout\_callback = yaml

i am getting error below

any suggestions Please ?

TASK [Gathering Facts] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [xxx]  
[WARNING]: Failure using method (v2\_runner\_on\_ok) in callback plugin (\<ansible.plugins.callback.foreman\_callback.CallbackModule object at 0x7f6108061690\>): ‘invocation’

And the host is not getting updated in UI of forman

Forman & ansible both are on same subnet & there is no firewall

thanks

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [August 10, 2020, 8:41am UTC](https://forum.ansible.com/t/ansible-foreman-callback-plugin/33572/2 "2020-08-10T08:41:35Z")

</div>

This list is for generic ansible issues.  
Your issue seems highly specific to a 3rd party module. I would try  
that community first:

[https://github.com/theforeman/foreman\_ansible#foreman-ansible-arrow\_forward](https://github.com/theforeman/foreman_ansible#foreman-ansible-arrow_forward)
