Hi, I have followed the instructions to set-up Foreman-Ansible and i never
see any hosts appear. This is a clean install on 2 vm clients (SL6 +SL7)
and a physical (Centos 7) machine. The 'master' server, foreman + ansible
is the SL7 vm.
All machines can resolve via hosts, hostname -f gives fqdn
I can execute any Ansible command and run playbooks.
Foreman has the 'master' in hosts via the puppet agent.
I have the plugin and callback installed
The callback has been modded for the foreman url https://sl7.localdomain.net, the ssl cert and key point to the
/etc/puppetlabs…pem files
I have tried ssl verify on and off
Foreman web Administer > settings > auth > Trusted puppetmaster hosts has
the fqdn [ sl7.localdomain.net ]
I am stumped, the hosts just never appear and there is nothing in the very
sparse plugin manual suggesting where to start looking.
> Hi, I have followed the instructions to set-up Foreman-Ansible and i never
> see any hosts appear. This is a clean install on 2 vm clients (SL6 +SL7)
> and a physical (Centos 7) machine. The 'master' server, foreman + ansible
> is the SL7 vm.
>
> All machines can resolve via hosts, hostname -f gives fqdn
> I can execute any Ansible command and run playbooks.
> Foreman has the 'master' in hosts via the puppet agent.
> I have the plugin and callback installed
> The callback has been modded for the foreman url
> https://sl7.localdomain.net, the ssl cert and key point to the
> /etc/puppetlabs…pem files
> I have tried ssl verify on and off
> Foreman web Administer > settings > auth > Trusted puppetmaster hosts has
> the fqdn [ sl7.localdomain.net ]
>
> I am stumped, the hosts just never appear and there is nothing in the very
> sparse plugin manual suggesting where to start looking.
What do you see in the foreman logs (/var/log/foreman/production.log)
when you run 'ansible-playbook'? You should see some call to
api/v2/hosts/facts
How about when you run 'ansible-playbook'? What's the output? The
callback needs to be installed on the host from which you run
'ansible-playbook' from in order to work
ok: [gtrnliwsts3.localdomain.net]
[WARNING]: Failure using method (v2_runner_on_ok) in callback plugin
(</root/.ansible/plugins/callback_plugins/foreman_callback.CallbackModule
object at 0x2fe3050>): [Errno
2] No such file or directory
[WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin
(</root/.ansible/plugins/callback_plugins/foreman_callback.CallbackModule
object at 0x2fe3050>):
[Errno 2] No such file or directory
It’s looking for something that isn’t there but I have no idea what.
I have renamed my servers but the same issue stands. The plugin and the
callback are installed on the Ansible/Foreman server, does the callback
need to be installed onto all the machines? here is the info you have asked
for;
Thanks for the log. That's certainly helpful. At first glance it looks
like you're using Ansible 2, which I haven't tested with the callback.
What's the output of 'ansible --version'?
Can you open your callback plugin file
(.ansible/plugins/callback_plugins/foreman_callback.py) and add a method
'v2_playbook_on_stats'? It'd be identical to the one you see here
(playbook_on_stats).
Let me know if that fixes the problem, if it works, feel free to send a pull
request to that repository or I'll do it myself. Thanks for reporting
the issue
···
On 08/03, 'KaneK' via Foreman users wrote:
>
> >
> > Morning,
> >
>
> I did a bit more poking around and now i have an error message that may
> actually be helpful;
>
> ansible-playbook -i 'gtrnliwsts3.localdomain.net,'
> /etc/ansible/roles/test-playbook.yml
> plugin foreman_callback.py: SSL verification of
> https://gtrnliwsts2.localdomain.net disabled
>
> PLAY [all]
> *********************************************************************
>
> TASK [setup]
> *******************************************************************
> ok: [gtrnliwsts3.localdomain.net]
> [WARNING]: Failure using method (v2_runner_on_ok) in callback plugin
> ( object at 0x2fe3050>): [Errno
> 2] No such file or directory
>
>
> TASK [command]
> *****************************************************************
> changed: [gtrnliwsts3.localdomain.net]
>
> PLAY RECAP
> *********************************************************************
> gtrnliwsts3.localdomain.net : ok=2 changed=1 unreachable=0 failed=0
>
> [WARNING]: Failure using method (v2_playbook_on_stats) in callback plugin
> ( object at 0x2fe3050>):
> [Errno 2] No such file or directory