Merge pull request #3 from oneswig/docker-mtu
Introduce configurable MTU for Docker-encapsulated networking
This commit is contained in:
commit
fce4df3143
@ -3,3 +3,4 @@
|
||||
hosts: docker
|
||||
roles:
|
||||
- role: docker
|
||||
docker_daemon_mtu: "{{ external_net_name | net_mtu }}"
|
||||
|
@ -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
|
||||
|
6
ansible/roles/docker/handlers/main.yml
Normal file
6
ansible/roles/docker/handlers/main.yml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: restart docker service
|
||||
service:
|
||||
name: docker
|
||||
state: restarted
|
||||
become: True
|
7
ansible/roles/docker/tasks/config.yml
Normal file
7
ansible/roles/docker/tasks/config.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Ensure the docker daemon configuration file exists
|
||||
template:
|
||||
src: daemon.json.j2
|
||||
dest: /etc/docker/daemon.json
|
||||
become: True
|
||||
notify: restart docker service
|
@ -6,6 +6,12 @@
|
||||
append: yes
|
||||
become: True
|
||||
|
||||
- name: Ensure Docker daemon is started
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
become: True
|
||||
|
||||
- name: Check whether docker storage is in loopback mode
|
||||
command: docker info
|
||||
register: docker_info
|
||||
@ -24,3 +30,5 @@
|
||||
|
||||
- include: storage.yml
|
||||
when: "{{ 'Data loop file' in docker_info.stdout }}"
|
||||
|
||||
- include: config.yml
|
||||
|
@ -4,6 +4,7 @@
|
||||
name: docker
|
||||
state: stopped
|
||||
become: True
|
||||
notify: restart docker service
|
||||
|
||||
- name: Ensure loopback storage state is absent
|
||||
file:
|
||||
@ -47,15 +48,3 @@
|
||||
lvchange --metadataprofile docker-thinpool
|
||||
{{ docker_storage_volume_group }}/{{ docker_storage_volume_thinpool }}
|
||||
become: True
|
||||
|
||||
- name: Ensure the docker daemon configuration file exists
|
||||
template:
|
||||
src: daemon.json.j2
|
||||
dest: /etc/docker/daemon.json
|
||||
become: True
|
||||
|
||||
- name: Ensure the docker daemon is running
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
become: True
|
||||
|
@ -1,8 +1,9 @@
|
||||
{
|
||||
"storage-driver": "devicemapper",
|
||||
"storage-opts": [
|
||||
"dm.thinpooldev=/dev/mapper/{{ docker_storage_volume_group | replace('-', '--') }}-{{ docker_storage_volume_thinpool | replace('-', '--') }}",
|
||||
"dm.use_deferred_removal=true",
|
||||
"dm.use_deferred_deletion=true"
|
||||
]
|
||||
"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",
|
||||
"dm.use_deferred_deletion=true"
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user