spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.9k stars 1.04k forks source link

Add a global config option for Docker network MTU #3502

Closed davidmehren closed 1 month ago

davidmehren commented 2 months ago

When using this playbook in...annoying network environments, it may be required to set the MTU of Docker networks to a lower value than the default of 1500. Also annoyingly, it is not sufficient to set a default MTU using Docker daemon options, as that gets ignored when custom networks are created.

This PR introduces a new config option matrix_playbook_docker_network_mtu, that needs to get referenced every time a new Docker network is created. I currently do not know a simpler way to achieve this outcome, but I'm open to suggestions 😃

Please let me know if you'd like the option to be named differently.

spantaleev commented 1 month ago

I've reworked this by:


With this, you should be able to use this in your vars.yml configuration:

devture_systemd_docker_base_container_networks_driver_options_custom:
  com.docker.network.driver.mtu: 1234

.. and have container networks with a custom MTU of 1234 created/updated.

Adjusting devture_systemd_docker_base_container_networks_driver_options_custom subsequently is possible to a limited extent:

davidmehren commented 1 month ago

Thanks! 🎉