Hey
I've tried the information in this
link:
http://michaeldehaan.net/post/35403909347/tips-on-using-debuggers-with-ansible
But cannot get Ansible to show the interactive shell for debugging, any
idea?
# ansible --forks 1 --module-path . localhost -m test -a ''
Where the test module contains code like..
import epdb
# ...
def some_function():
x = some_random_object.something_interesting()
epdb.st()
On Tuesday, June 10, 2014 2:37:45 AM UTC+8, Jaime Gago wrote:
>
> You might also want to read this post
>
>
> http://michaeldehaan.net/post/35403909347/tips-on-using-debuggers-with-ansible
>
> J.
>
> On Monday, June 9, 2014 7:24:27 AM UTC-7, James Cammarata wrote:
>>
>> 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/40b1a27b-1dc9-4b24-8062-2bf72567db11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.