How to add verbosity to ansible.runner.Runner ?

560 views
Skip to first unread message

Ethan Collins

unread,
Nov 8, 2014, 4:33:25 PM11/8/14
to ansible...@googlegroups.com
I am not yet using playbooks. Calling ansible.runner.Runner from python to run modules. How can I add verbosity (like using -vvvv when running ansible from shell) ?

Matt Martz

unread,
Nov 8, 2014, 5:51:56 PM11/8/14
to ansible...@googlegroups.com
Verbosity is actually increased by setting a variable in ansible.utils

Such as:

ansible.utils.VERBOSITY = 4

The value is the NUMBER representation of how many v's you want to specify.

On Sat, Nov 8, 2014 at 3:33 PM, Ethan Collins <collins...@gmail.com> wrote:
I am not yet using playbooks. Calling ansible.runner.Runner from python to run modules. How can I add verbosity (like using -vvvv when running ansible from shell) ?

--
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/4bd5a5ab-033f-480d-8c57-cabbbab9f755%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net

Ethan Collins

unread,
Nov 8, 2014, 6:42:13 PM11/8/14
to ansible...@googlegroups.com
Thanks Matt.

I am trying to debug the copy module which I am using to transfer an image from linux to XP on virtualbox on the same host (for subsequent processing). I am using SSH, with ControlPersist, scp_if_ssh and pipelining turned on.

When I first copy the file, ~700KB, it takes ~3.5 secs. Subsequently, ie when the file exists in the target location, it takes ~1.2 secs.

I understand from debug logs that during the first copy operation, it does the copy. And during the overwrite operation, it doesn't as mostly MD5 checksum says so. What I don't understand is that scp of the same file, irrespective of copy or overwrite, takes < 1sec. Why does ansible take so long a time?

Any light on the functioning of the copy module is greatly appreciated. The only other method I have to overcome this induced delay is doing an scp.

Greg Andrews

unread,
Nov 8, 2014, 7:13:34 PM11/8/14
to ansible...@googlegroups.com

On Sat, Nov 8, 2014 at 3:42 PM, Ethan Collins <collins...@gmail.com> wrote:
I understand from debug logs that during the first copy operation, it does the copy. And during the overwrite operation, it doesn't as mostly MD5 checksum says so. What I don't understand is that scp of the same file, irrespective of copy or overwrite, takes < 1sec. Why does ansible take so long a time?

After you reboot the XP in virtualbox and Linux (also under virtualbox?), what happens to the transfer times when you do the scp first and the Ansible copy second?

  -Greg

Ethan Collins

unread,
Nov 11, 2014, 12:31:59 PM11/11/14
to ansible...@googlegroups.com
I tried this today after rebooting XP and the timing is the same -- scp takes < 1 sec and ansible taking 1.2 sec, as I didn't delete the already copied file. After I deleted, ansible took 3.5 secs.

I am on Linux host and running XP on virtualbox on the same Linux host.

Any idea why ansible takes 3.5 secs when it has to copy the file (sz: ~700KB) ?

-Ethan
Reply all
Reply to author
Forward
0 new messages