Second pass at Docker MTU assignment

This commit is contained in:
stack 2017-03-22 09:30:59 +00:00
parent a5fe4b7702
commit cf5db1d59c
3 changed files with 7 additions and 13 deletions

View File

@ -5,4 +5,3 @@
dest: /etc/docker/daemon.json
become: True
notify: restart docker service

View File

@ -6,6 +6,12 @@
append: yes
become: True
- name: Check Docker state with systemd
service:
name: docker
state: started
become: True
- name: Check whether docker storage is in loopback mode
command: docker info
register: docker_info
@ -25,15 +31,4 @@
- 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'"

View File

@ -1,6 +1,6 @@
{
"storage-driver": "devicemapper",
"mtu": 1450,
"mtu": {{ external_net_name | net_mtu }},
"storage-opts": [
"dm.thinpooldev=/dev/mapper/{{ docker_storage_volume_group | replace('-', '--') }}-{{ docker_storage_volume_thinpool | replace('-', '--') }}",
"dm.use_deferred_removal=true",