How to debug Ansible modules

Hi,

I'm looking to peek into an Ansible module. It is the 'unarchvie'
module which in special circumstances is not idempotent
(https://github.com/ansible/ansible/issues/57303). I read the code. It
looks sensible to me. Now, I would like to check how it actually works
with some data.

Thanks,
Wawrzek

This should be of help: https://docs.ansible.com/ansible/latest/dev_guide/debugging.html

kind regards
Pshem

The unarchive has some nice debug option but they are commented out on line 436[1], 590[2] and 870[3].
And with the callback plugin debug you get some nice output, and you can always add more "err +=" to get more output.

I might have spotted the bug in finding the debug line numbers, this PR 43479[4] in line 317
pwname has become pwnam

[1] https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/unarchive.py#L436
[2] https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/unarchive.py#L590
[3] https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/files/unarchive.py#L870
[4] https://github.com/ansible/ansible/pull/43479/files#diff-5947943aa1aba46541842caf34f526aeR317

It's not it's called pwname
https://docs.python.org/2/library/pwd.html#pwd.getpwnam