I have a home server where I run 15+ containers. Some use common databases and some write to volumes. I have some tasks that need to be run before some of the containers and some tasks used to pull configuration from the server to the ansible controller.
How do I best arrange all of these containers in ansible? Right now I have every container in its own role, but that leads to a lot of code duplication.
I have looked into compose, but as I need to run task before some containers start, it does not seem like a good fit.
Another idea is to try and write a role for all containers that then creates containers based on a config file, but that seem like recreating docker compose with some small extensions.
Any best practise here or suggestions and experience?