What do you want to do in a playbook that requires it to be tested?
We keep our roles very simple and they will not do anything complicated. Ansible is for configuring a machine, that’s it.
If we need to do anything more complicated, we’ll write it in a testable program (usually in Go).