This is more of a topic for ansible-devel, but to answer your question you can use the hacking/test-module script to run your module. At that point, you can either use print statements or epdb to debug your code, since it's running locally. If you only want to test your module remotely (ie. a normal ansible run), you can always use the built-in syslog functionatliy.
Normally you should not use print statements because it breaks the JSON output. On Mon, Jun 9, 2014 at 9:09 AM, <[email protected]> wrote: > According to this: http://docs.ansible.com/developing_modules.html, it > said... > > You should also never do this in a module: > > print "some status message" > > > So, how to debug or log message during the development of Ansible module? > > Thanks > > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/b9e18a9b-f079-4cac-85c8-fd6bb545c2fb%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/b9e18a9b-f079-4cac-85c8-fd6bb545c2fb%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAMFyvFjC_vWMEy6Zw6BSt%2BiyNUokMWuDQ2NjSeBpQFmbnTmKHw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
