On Saturday, May 9, 2015 at 5:49:22 AM UTC-4, Ayaz Ahmed Khan wrote:
>
> On Friday, May 8, 2015 at 6:04:35 PM UTC+5, Ayaz Ahmed Khan wrote:
>>
>> Hi
>>
>> When I execute a playbook through the playbook Python API, is there a way 
>> to toggle the verbosity of the output? I have enabled logging for Ansible 
>> by configuring the `log_path` variable as well as by using a `log_plays` 
>> callback, but have not succeeded in achieving very verbose output of 
>> Ansible activity. 
>>
>
>
> Having looked around more, I found out that the 
> "callbacks.PlaybookCallbacks() and callbacks.PlaybookRunnerCallbacks()" 
> both take a "verbose" parameter, the value of which by default is 0. I 
> changed the value of that parameter to 4, which I believe corresponds to 
> the -vvvv switch on the command-line. But it has made no difference in the 
> verbosity of the output of the callbacks. I'm stumped.  
>

If anyone is curious, I got it working when I set the verbosity locally 
this way

from ansible import utils
def foo(...)
    utils.VERBOSITY = 4
    playbook_cb = PlaybookCallbacks(verbose=utils.VERBOSITY)
    # do the same for runner if you want

I think somehow, VERBOSITY gets reset inside of Ansible. 

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/204ef9e3-188e-4384-9be4-19504c4f75aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to