Currently, I am trying to troubleshoot an action plugin that calls other working Ansible modules to reuse the code, making the playbook for those modules a lot simpler to use.
Previously when testing the other smaller modules, if I couldn't uncover the error when running my test playbook, I would make a json file of the playbook's arguments and supply it to pdb like so:
python -m pdb /path/to/module.py ./test.json
You should enforce
tty. This code works for me when debugging Ansible plugins:
import sys; sys.stdin = open('/dev/tty') import pdb; pdb.set_trace()