# PyCharm & Modules

**URL:** <https://forum.ansible.com/t/pycharm-modules/16635>\
**Category:** Ansible Project\
**Created:** [October 29, 2014, 4:52pm UTC](https://forum.ansible.com/t/pycharm-modules/16635 "2014-10-29T16:52:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tennis\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Tennis\_Smith](https://forum.ansible.com/u/Tennis_Smith)\
**Post date:** [October 29, 2014, 4:52pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/1 "2014-10-29T16:52:11Z")

</div>

Hi,

Has anyone found a good way to debug ansible modules via the PyCharm debugger?

-T

---

<div class="post-metadata">

**Author:** ![Jon\_Forrest](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@Jon\_Forrest](https://forum.ansible.com/u/Jon_Forrest)\
**Post date:** [October 29, 2014, 8:49pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/2 "2014-10-29T20:49:45Z")

</div>

```auto
I did a little looking into this. The first problem is making Ansible
not delete the modules on the remote host. The documentation page

[http://docs.ansible.com/developing_modules.html#check-mode](http://docs.ansible.com/developing_modules.html#check-mode)

mentions how to do this, although it would be nice if there were
a module-specific directive that turned this on for just the
one module, something like

tasks:
   - name: ensure apache is at the latest version
     yum: pkg=httpd state=latest module-save=True

That said, my understanding is that the remote modules don't
require anything other than standard python, which is why Ansible
isn't required on the remote node. So, you "should" be able to run
a remote module using your favorite debugging method. I haven't
tried this, and I'm not an Ansible expert, so I'd be interested
in finding out if this works.

Jon Forrest

```

---

<div class="post-metadata">

**Author:** ![Tennis\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Tennis\_Smith](https://forum.ansible.com/u/Tennis_Smith)\
**Post date:** [October 29, 2014, 9:07pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/3 "2014-10-29T21:07:40Z")

</div>

Thanks, Jon. I’ll poke around.  
-T

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 29, 2014, 9:13pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/4 "2014-10-29T21:13:27Z")

</div>

also look at hacking/test-module, it allows a debugger to attach to test a module directly

---

<div class="post-metadata">

**Author:** ![Tennis\_Smith](https://avatars.discourse-cdn.com/v4/letter/t/f05b48/32.png) [@Tennis\_Smith](https://forum.ansible.com/u/Tennis_Smith)\
**Post date:** [October 29, 2014, 10:38pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/5 "2014-10-29T22:38:03Z")

</div>

Good idea. Thanks.  
-T

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 30, 2014, 8:42pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/6 "2014-10-30T20:42:29Z")

</div>

Possibly useful - [http://michaeldehaan.net/post/35403909347/tips-on-using-debuggers-with-ansible](http://michaeldehaan.net/post/35403909347/tips-on-using-debuggers-with-ansible)

---

<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:** [September 5, 2016, 2:36am UTC](https://forum.ansible.com/t/pycharm-modules/16635/7 "2016-09-05T02:36:01Z")

</div>

Hi Smith,

Found any good way to accomplish this? Debugging Ansible modules via PyCharm debugger?

---

<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:** [September 6, 2016, 4:03pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/8 "2016-09-06T16:03:11Z")

</div>

I figured out a way to debug using PyCharm remote debugger. I have written down the steps here if anyone else needs info:

[https://github.com/mmumshad/debug-ansible-modules-pycharm](https://github.com/mmumshad/debug-ansible-modules-pycharm)

Thanks  
Mumshad

---

<div class="post-metadata">

**Author:** ![Deepak\_Kothandan](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Deepak\_Kothandan](https://forum.ansible.com/u/Deepak_Kothandan)\
**Post date:** [September 24, 2016, 2:58pm UTC](https://forum.ansible.com/t/pycharm-modules/16635/9 "2016-09-24T14:58:10Z")

</div>

Hi All,

Firstly, I would like to thank Mumshad Mannambeth, for sharing his github document which helped me in doing the setup.

I have written a couple of post on debugging Ansible using Pycharm.

1. Setting up pycharm and a ubuntu vagrant box, to debug Custom Ansible modules, so the ansible code stays on the host, and is easier to develop, The link to this post is [Debugging Ansible with Pycharm](https://medium.com/@deepak.kothandan/debugging-custom-ansible-modules-with-pycharm-a2d83a5cb28c#.ohhr24f7m)

2. Using the same setup, also wrote a second post, which explains about debugging existing modules and callback plugins and the link is [Debugging Ansible callbacks with pycharm](https://medium.com/@deepak.kothandan/debugging-existing-ansible-modules-and-callback-plugins-with-pycharm-part-2-a75d1902a390#.8rd0nk3q2)

Hope this helps. Thanks

---

<div class="post-metadata">

**Author:** ![Jae\_Kim](https://avatars.discourse-cdn.com/v4/letter/j/b9e5f3/32.png) [@Jae\_Kim](https://forum.ansible.com/u/Jae_Kim)\
**Post date:** [November 30, 2017, 6:48am UTC](https://forum.ansible.com/t/pycharm-modules/16635/10 "2017-11-30T06:48:03Z")

</div>

Is there a way to debug without having to purchase the professional version of Pycharm?
