# Ansibug - Debugging Modules Workflow Ideas

**URL:** <https://forum.ansible.com/t/ansibug-debugging-modules-workflow-ideas/46808>\
**Category:** Project Discussions\
**Tags:** debugging, ansibug\
**Created:** [November 22, 2026, 11:23am UTC](https://forum.ansible.com/t/ansibug-debugging-modules-workflow-ideas/46808 "2026-11-22T11:23:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [November 22, 2026, 11:23am UTC](https://forum.ansible.com/t/ansibug-debugging-modules-workflow-ideas/46808/1 "2026-11-22T11:23:48Z")

</div>

The next feature I really want to bring to [ansibug](https://jborean93.github.io/ansibug/) is the ability to also debug modules at the same time as a playbook itself.

I’ve got a POC that essentially does this and I can debug both Python and PowerShell modules in my local changes but there are a few UX concerns I have. The biggest problem is the overhead added to invoking a module in setting up the debugger. Doing this by default would just slow things down dramatically and is arguably not the best decision.

My current approach is to only activate the module debugger when ansibug steps into a task. For example I’ve placed a breakpoint on a task and by clicking Step Into (F10) it will hook up the module side of things and activate the debugger for that

 ![Hit a breakpoint on the task, Step Into (F10) steps into the module](https://us1.discourse-cdn.com/ansible/original/2X/3/369e3179a566a6f930234e2c38c2d9a3bf41ea57.webp)

 ![A PowerShell module that was stepped into](https://us1.discourse-cdn.com/ansible/original/2X/e/e9215adf3e06237f6d9ac9a2e64bde7a8ddca5b7.webp)

This works but it requires the 2 steps to first break on the task/host you want to debug with, then step in to actually debug that module.

Another option I’ve been looking at was [BreakpointMode](https://microsoft.github.io/debug-adapter-protocol//specification.html#Types_BreakpointMode) to allow a user to set a specific breakpoint mode on the task that would optionally break on the task (default) or on the module invocation (new mode). Unfortunately these modes cannot be defined by the extension and only appear once a new session has started. The UX for setting them isn’t the best as well as you need to right click the breakpoint, edit breakpoint, then set the mode in the expression.

 ![Fresh session, we cannot see the modes until ansibug runs once](https://us1.discourse-cdn.com/ansible/original/2X/f/f51b6e164aa506034331a8352ff8f722c37a03f7.png)

 ![What a user sees when editing a breakpoint](https://us1.discourse-cdn.com/ansible/original/2X/7/7ed1f1af1e6c5c2b2ae1cd85a668975afdff65d6.png)

 ![The different mode types](https://us1.discourse-cdn.com/ansible/original/2X/0/0268b12458ea0db9bc6b4fb40656f97f7394e7b1.png)

My gut feeling is to have both as an option as it gives flexibility on both ways. I was also considering having the VSCode extension request breakpoints set for `.py` or `.ps1` files and check if they will be run for the current task but:

- I’m unsure if that can actually be done
- We could miss modules an action plugin may run, e.g. we only really have the task name

There are other limitations right now with the Python and PowerShell debugging side but as it’s a POC I am hoping to find ways around those limitations but it is still very early days.

If anyone has any other suggestions or thoughts on this functionality I would love to hear it.
