Mailcow-dockerized: Use ansible instead of docker-compose

Created on 26 May 2019  路  9Comments  路  Source: mailcow/mailcow-dockerized

I am currently very frustrated with the way docker-compose is managing the container and volume deployments.
As a consequence I am currently migrating my mailcow deployment to Ansible, which will replace docker-compose entirely.
In addition, this will also ease the configuration handling and e.g. allow the use of Traefik as ingress endpoint. Traefik would manage SSL termination as well as ACME out of the box.

All 9 comments

Hello,
I am not quite sure why you opened this issue, we will defiantly not move away from compose to Ansible. Docker-compose is quite fine and its very easy too use, with Ansible you have a lot of more work to do, and its not that "user friendly". Don't get me wrong Ansible is awesome, and I also use it to setup my server. But its simply out of scope for this project. But if you plan to create a Ansible role that does all of that you are welcome to publish it, so other people can use it. Actually what frustrates you about docker-compose?

With docker-compose I am really missing out a template engine, which supports more sophisticated configuration. Also I am not a huge fan of having a cloned repository on the host running mailcow as a "source" for configuration files.

I actually planned on writing an ansible module but also have a playbook available that applies the module to localhost. This would essentially make docker-compose obsolete.

But sure, I can add this to a separate repository or keep it in a fork!

ansible is a good method of directing VMs and LXC, but for a mailserver you would tie down the users to a specified linux distribution, otherwise it will systematically break regularly.
In other words: to have ansible roles for such a complex setup working on different ubuntu versions and perhaps even debian, Arch and whatever... keeping it user friendly and not breaking regularly: very, very tough challenge.

I would suggest using docker_container and the corresponding docker_network and docker_volume modules.

Tbh, I do not see how this will break regulary

Well you will still have to use git to clone the configuration of the containers that is inside of the /data/conf folder in this repo. And of course you will have to redo every change to the docker-compose to your Ansible role as well which can be a lot of work to maintain.

@xvzf Mailcow is built around the GIT repository, and won't work without it.

This have been discussed in the past. Mailcow is not a classic Dockerized environment.

Goal is to have a single host, easy to use mailbox solution. Which it works great for. Integration in bigger Docker or even k8s platforms is not intended and not supported currently.

Okay, I see. This might not be the solution I'm looking for!

Just to keep you guys up to date: Here's what I am currently testing (just for traefik though, not migrated to ansible yet):
This for extracting the SSL certificate: https://github.com/xvzf/mailcow-acme-traefik
with a slightly modified docker-compose.yml: https://github.com/xvzf/mailcow-dockerized/tree/traefik

(ansible roles for server provisioning can be found here)

Thank you for sharing!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

patrick7 picture patrick7  路  3Comments

poldixd picture poldixd  路  3Comments

Braintelligence picture Braintelligence  路  3Comments

lgleim picture lgleim  路  3Comments

mritzmann picture mritzmann  路  3Comments