Introduce 1450 MTU for Docker-encapsulated networking
This commit is contained in:
parent
0096f42508
commit
a5fe4b7702
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
|
8
ansible/roles/docker/tasks/config.yml
Normal file
8
ansible/roles/docker/tasks/config.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Ensure the docker daemon configuration file exists
|
||||
template:
|
||||
src: daemon.json.j2
|
||||
dest: /etc/docker/daemon.json
|
||||
become: True
|
||||
notify: restart docker service
|
||||
|
@ -24,3 +24,16 @@
|
||||
|
||||
- include: storage.yml
|
||||
when: "{{ 'Data loop file' in docker_info.stdout }}"
|
||||
|
||||
- name: Read Docker daemon config file
|
||||
slurp:
|
||||
src: /etc/docker/daemon.json
|
||||
register: docker_daemon_conf
|
||||
become: True
|
||||
|
||||
- name: Parse Docker daemon config JSON
|
||||
set_fact:
|
||||
docker_daemon_json: "{{ docker_daemon_conf['content'] | b64decode | from_json }}"
|
||||
|
||||
- include: config.yml
|
||||
when: "{{ docker_daemon_json['mtu'] }} != 1450 or {{ docker_daemon_json['storage-driver'] }} != 'devicemapper'"
|
||||
|
@ -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": 1450,
|
||||
"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…
Reference in New Issue
Block a user