# how to debug an ansible module

**URL:** <https://forum.ansible.com/t/how-to-debug-an-ansible-module/24949>\
**Category:** Ansible Project\
**Created:** [July 11, 2017, 10:10am UTC](https://forum.ansible.com/t/how-to-debug-an-ansible-module/24949 "2017-07-11T10:10:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Margin\_Hu](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@Margin\_Hu](https://forum.ansible.com/u/Margin_Hu)\
**Post date:** [July 11, 2017, 10:10am UTC](https://forum.ansible.com/t/how-to-debug-an-ansible-module/24949/1 "2017-07-11T10:10:17Z")

</div>

Hi Guys,

how to debug an ansible module ? I find [http://docs.ansible.com/ansible/dev\_guide/developing\_modules.html](http://docs.ansible.com/ansible/dev_guide/developing_modules.html), but failed to run it as following.

how do you do testing when develop one module ?

[root@server120 ansible-module]# ansible/hacking/test-module -m ./kolla\_docker.py

- including generated source, if any, saving to: /root/.ansible\_module\_generated
- ansiballz module detected; extracted module source to: /root/debug\_dir

---

<div class="post-metadata">

**Author:** ![Mumshad\_Mannambeth](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mumshad\_Mannambeth](https://forum.ansible.com/u/Mumshad_Mannambeth)\
**Post date:** [July 18, 2017, 2:25pm UTC](https://forum.ansible.com/t/how-to-debug-an-ansible-module/24949/2 "2017-07-18T14:25:22Z")

</div>

Hi Margin,

I usually use an IDE like PyCharm for this. I have detailed it here:  
[https://github.com/mmumshad/debug-ansible-modules-pycharm](https://github.com/mmumshad/debug-ansible-modules-pycharm)

Thanks  
Mumshad
