How to use display.vvv in an Ansible module?

599 views
Skip to first unread message

Hiroaki Nakamura

unread,
Jun 10, 2016, 8:28:18 AM6/10/16
to ansibl...@googlegroups.com
Hi all,

I'm creating the lxd_container module and would like to use
display.vvv for debug prints.
https://github.com/ansible/ansible-modules-extras/pull/2208

I copied code in some module, but nothing was printed.
Could someone show me an example code to use display.vvv?

Regards,
Hiroaki

Brian Coca

unread,
Jun 10, 2016, 9:47:52 AM6/10/16
to Hiroaki Nakamura, Ansible Development
​modules do not display anything (as they normally execute remotely), you CAN pass information back in the return JSON.

In 2.1 modules do get information about the verbosity level so you can query module.verbosity (or _ansible_verbosity if not using AnsibleModule class), to decide if you want to return the info or not.

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

Hiroaki Nakamura

unread,
Jun 11, 2016, 10:41:32 AM6/11/16
to Brian Coca, Ansible Development
Hi Brian,

Thanks for the info. Actually I pass the debugging information back in
the return JSON.
Glad to know that in 2.1 modules can get the verbosity level.

Thanks!

Udondan

unread,
Jul 7, 2016, 8:40:15 AM7/7/16
to Ansible Development, hnak...@gmail.com
Thanks Brian,

little correction though, it is module._verbosity.

Cheers,
Daniel
Reply all
Reply to author
Forward
0 new messages