Project

General

Profile

Actions

Bug #23413

closed

Foreman 1.16.1 & Ansible 2.5 callback error

Added by prem prakash over 6 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
medium
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

New to Foreman, I am trying to integrate Ansible with Foreman 1.16.1
Using 2 different server 1. Foreman 2. Ansible

Ansible Server
Followed the steps: https://www.theforeman.org/plugins/foreman_ansible/0.x/index.html
1. etc/ansible/ansible.cfg Updated (callback_plugins = ~/.ansible/plugins/callback_plugins/
bin_ansible_callbacks = True)
2. New File: ~/.ansible/plugins/callback_plugins/foreman_callback.py
Foreman Server:
1. Update /etc/environment & /etc/sysconfig/foreman file with URL update
FOREMAN_URL=https://<foreman url>
FOREMAN_SSL_CERT=/etc/foreman/client_cert.pem
FOREMAN_SSL_KEY=/etc/foreman/client_key.pem
FOREMAN_SSL_VERIFY=0

I am using Centos7.4

While running playbook in ansible I am getting this error:

[WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin (&lt;ansible.plugins.callback.foreman_calback.CallbackModule object
at 0xd199d0>): 'module' object has no attribute 'dumps'

Callback Exception:
File "/usr/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 375, in send_callback
method(*new_args, **kwargs)
File "/usr/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py", line 389, in v2_playbook_on_stats
self.playbook_on_stats(stats)
File "/root/.ansible/plugins/callback_plugins/foreman_calback.py", line 234, in playbook_on_stats
self.send_reports(stats)
File "/root/.ansible/plugins/callback_plugins/foreman_calback.py", line 155, in send_reports
log = self._build_log(self.items[host])
File "/root/.ansible/plugins/callback_plugins/foreman_calback.py", line 132, in _build_log
'messages': {'message': json.dumps(msg)},

If I am following these instructions: https://github.com/theforeman/theforeman.org/blob/gh-pages/plugins/foreman_ansible/2.x/index.md

As ansible is 2.5

/etc/ansible/ansible.cfg only changes (bin_ansible_callbacks = True
callback_whitelist = foreman)

with this file ~/.ansible/plugins/callback_plugins/foreman.py
I am not getting any error but there is not Host update in Foreman

Actions

Also available in: Atom PDF