diff --git a/ansible/docker.yml b/ansible/docker.yml index 698896042..1a55725f9 100644 --- a/ansible/docker.yml +++ b/ansible/docker.yml @@ -3,3 +3,4 @@ hosts: docker roles: - role: docker + docker_daemon_mtu: "{{ external_net_name | net_mtu }}" diff --git a/ansible/roles/docker/defaults/main.yml b/ansible/roles/docker/defaults/main.yml index 59c3bdaf9..c43413338 100644 --- a/ansible/roles/docker/defaults/main.yml +++ b/ansible/roles/docker/defaults/main.yml @@ -20,3 +20,6 @@ docker_storage_thinpool_autoextend_threshold: 80 # Percentage by which to extend thin-provisioned docker storage volumes. docker_storage_thinpool_autoextend_percent: 20 + +# MTU to pass through to containers not using net=host +docker_daemon_mtu: 1500 diff --git a/ansible/roles/docker/templates/daemon.json.j2 b/ansible/roles/docker/templates/daemon.json.j2 index 67eab7a81..4f229af35 100644 --- a/ansible/roles/docker/templates/daemon.json.j2 +++ b/ansible/roles/docker/templates/daemon.json.j2 @@ -1,6 +1,6 @@ { "storage-driver": "devicemapper", - "mtu": {{ external_net_name | net_mtu }}, + "mtu": {{ docker_daemon_mtu }}, "storage-opts": [ "dm.thinpooldev=/dev/mapper/{{ docker_storage_volume_group | replace('-', '--') }}-{{ docker_storage_volume_thinpool | replace('-', '--') }}", "dm.use_deferred_removal=true",