What is the best way to create a module neatly containing terraform and ansible files?

I’m trying to organise my instances entirely within modules so that I can avoid rebuilding images unless the hashes on those submodules or var inputs change.

I have been challenged for a while on getting terraform and ansible to play nice with this design challenge, and I wanted to see if anyone here had suggestions on doing it well.

Generally Ansible wants all its files in one root structure collections do provide some better ability to have playbooks and roles contained in modules though within that root structure.

Should I try and keep my terraform ansible code in an ansible collection or the other way around? Have any of you had success in doing this and how did you do it?