Hello,
I’ve setup a test Ubuntu 16.04 VM with Ansible (just 2 small playbooks) which work just fine. Installed and configured Formean (installed the plugins, changed the ansible.cfg file to callback the plugin etc…)
I keep running into the following error whenever I try running a simple playbook
[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin (): HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /api/v2/hosts/facts (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',))
Now the issue here is that it keeps trying to access the localhost via port 3000 and no matter what I change it keeps erroring in that port. I’ve looked at the foreman_callback.py script and confirmed that it is listening on 443 but I’ve changed to everything I can think of, port 80, port 3000 (as it looks like that’s what it goes to by default) and nothing works. I’ve disabled the firewall, I’ve even made changes to the apache2/sites-enabled foreman host files but nothing seems to work.
My question is, how do I change that CallbackModule: HTTPConnectionPool to use port=443 or any other port for that matter. It looks like that is the only error I have. I can see that it is gathering the facts but it fails to send it to Foreman because of the incorrect port.
This is the Play Recap I get:
PLAY RECAP ****************************************************************************************************************************************************************************************** ansibletest : ok=2 changed=1 unreachable=0 failed=0 apache : ok=2 changed=1 unreachable=0 failed=0 [WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin (): HTTPConnectionPool(host='localhost', port=3000): Max retries exceeded with url: /api/v2/reports (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused',)) Callback Exception: File "/usr/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 375, in send_callback method(*new_args, **kwargs) File "/usr/lib/python2.7/dist-packages/ansible/plugins/callback/foreman.py", line 221, in v2_playbook_on_stats self.send_reports(stats) File "/usr/lib/python2.7/dist-packages/ansible/plugins/callback/foreman.py", line 199, in send_reports verify=self.ssl_verify) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 107, in post return request('post', url, data=data, json=json, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/api.py", line 53, in request return session.request(method=method, url=url, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 468, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 576, in send r = adapter.send(request, **kwargs) File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 437, in send raise ConnectionError(e, request=request) [WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin (): 'module' object has no attribute 'dumps' Callback Exception: File "/usr/lib/python2.7/dist-packages/ansible/executor/task_queue_manager.py", line 375, in send_callback method(*new_args, **kwargs) File "/usr/lib/python2.7/dist-packages/ansible/plugins/callback/init.py", line 376, in v2_playbook_on_stats self.playbook_on_stats(stats) File "/home/vagrant/.ansible/plugins/callback_plugins/foreman_callback.py", line 234, in playbook_on_stats self.send_reports(stats) File "/home/vagrant/.ansible/plugins/callback_plugins/foreman_callback.py", line 155, in send_reports log = self._build_log(self.items[host]) File "/home/vagrant/.ansible/plugins/callback_plugins/foreman_callback.py", line 132, in _build_log 'messages': {'message': json.dumps(msg)},