Ansible Python API 2.0 - capture warnings

37 views
Skip to first unread message

Suren Baskaran

unread,
Apr 11, 2018, 4:19:53 AM4/11/18
to Ansible Project
Hello All
Been circling around the Callbackbase with all possible tries , but I could not find a way till now to capture these warnings from a playbook execution with the API output

[WARNING]:  * Failed to parse hosts/UAT/ dictionary, got: <class 'ansible.parsing.yaml.objects.AnsibleUnicode'>

 [WARNING]:  * Failed to parse /hosts/UAT/ssh_keys/dbrun_46186_1_uat with ini plugin:: Expected key=value host variable assignment, got: RSA

 [WARNING]: Could not match supplied host pattern, ignoring: primary_host


Appreciate some help - on how to capture these warning messages when we run playbooks via the API?

Brian Coca

unread,
Apr 11, 2018, 9:49:03 AM4/11/18
to Ansible Project
Warnings are not currently handled by callbacks, the Display class handles them.


--
----------
Brian Coca

Suren Baskaran

unread,
Apr 12, 2018, 2:22:36 AM4/12/18
to ansible...@googlegroups.com
Thanks for the prompt response Brian

Any examples or references on how to integrate the display with playbook executor callbacks ?

Appreciate your response

Thanks,
Suren VB

From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Brian Coca <bc...@redhat.com>
Sent: Wednesday, April 11, 2018 7:18:50 PM
To: Ansible Project
Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings
 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7eFcKLzY5_doDDmQ17UTpsXkLCHkUwM6j2MgyLfFKJY6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Suren Baskaran

unread,
Apr 12, 2018, 7:06:58 PM4/12/18
to ansible...@googlegroups.com
Hey Brain
Appreciate some pointers here

Thanks,
Suren VB

From: Suren Baskaran <sure...@gmail.com>
Sent: Thursday, April 12, 2018 11:52:23 AM
To: ansible...@googlegroups.com; Ansible Project

Subject: Re: [ansible-project] Ansible Python API 2.0 - capture warnings

Suren Baskaran

unread,
Apr 16, 2018, 8:11:23 AM4/16/18
to ansible...@googlegroups.com
Hey Guys
Badly need some pointers here - as I am running out of options

Fiddling with the display Utils gives me the needed verbose but to stdout and not the callbacks

Thanks,
Suren VB

From: Suren Baskaran <sure...@gmail.com>
Sent: Friday, April 13, 2018 4:36:41 AM
Reply all
Reply to author
Forward
0 new messages