vscode-ansible
vscode-ansible copied to clipboard
Add debugging support
Adds support for debugging playbooks using the ansibug library. This allows users to launch a debuggable playbook through this extension or attach to an existing playbook process launched by ansibug.
This requires https://github.com/jborean93/ansibug to be installed in the Python environment used by the extension. We need to have a conversation around whether this should be bundled with this extension or whether the user supplies it themselves. We could support both with the bundled version being a fallback. For now it just needs to be manually installed with
python -m pip install ansibug
Fixes: https://github.com/ansible/vscode-ansible/issues/760 Related: AAP-19811
I think this PR is ready for a proper review. Please let me know what might be missing or needs to be fixed up so I can get it ready to be merged.
@nitzmahone Considering the upcoming changes in core, please advise if we want to get this in as experimental and rewrite it once core changes get implemented. I do think that there is a lot of interest in playing with this feature.
not a lot of interest ???? use so many jinja template scripts that a debugger would be a lifesaver for me as we all know syntax errors for jinja are the opposite of useful, and ib general I want to know what the output of those script into playbook variables look like, so a ansible playbook debugger is an absolute necessity
and I'm not talking of a python debugger used to debug ansible somehow
Closing as we decided to delay implementing this in extension until ansible-core receives native support for debugging, anyone can try using https://marketplace.visualstudio.com/items?itemName=jborean.ansibug
Big changes coming in 2.18 to the guts of our Jinja integration that make diagnosing template issues easier- we can now track the provenance of all vars, and we've majorly overhauled the bookkeeping we do during templating, so a lot of problems that used to just silently fail are now loudly in your face, with error messages that can show you the entire template stack that was running when the problem occurred. A number of those things are already accessible through Jordan's ansibug VSCode Ansible debugger prototype in currently-released Ansible, and a lot more capabilities will be accessible once the debugger hook support is properly integrated in core.