664d068ef7
As described inline, we should lower the MTU in the docker configuration when we see the interface has a MTU lower than 1500 so things "just work". This particularly affects the Linaro ARM64 cloud in OpenDev, but it is a generic issue. Change-Id: I338616c41a65b007d56648fdab6da2a6a6b909f4 Story: https://storyboard.openstack.org/#!/story/2008230
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
---
|
|
|
|
- name: Ensure "docker" group exists
|
|
group:
|
|
name: "{{ docker_group }}"
|
|
state: present
|
|
|
|
- name: Add user to docker group
|
|
user:
|
|
name: "{{ ansible_user }}"
|
|
groups:
|
|
- "{{ docker_group }}"
|
|
append: yes
|
|
|
|
- name: Update docker daemon proxy configuration
|
|
when: docker_userland_proxy is defined
|
|
include_role:
|
|
name: update-json-file
|
|
vars:
|
|
update_json_file_name: /etc/docker/daemon.json
|
|
update_json_file_combine:
|
|
userland-proxy: "{{ docker_userland_proxy }}"
|
|
update_json_file_become: true
|
|
|
|
# Docker defaults to a MTU of 1500, which causes problems when the
|
|
# main interface has a MTU less than that. Cloud environments often
|
|
# have this, one good example is OpenDev's Linaro ARM64 cloud.
|
|
# https://storyboard.openstack.org/#!/story/2008230
|
|
- name: Lower default MTU
|
|
when: ansible_default_ipv4.mtu < 1500
|
|
include_role:
|
|
name: update-json-file
|
|
vars:
|
|
update_json_file_name: /etc/docker/daemon.json
|
|
update_json_file_combine:
|
|
mtu: 1400
|
|
update_json_file_become: true
|
|
|
|
- name: Restart docker
|
|
when: >-
|
|
(docker_userland_proxy is defined) or
|
|
(ansible_default_ipv4.mtu < 1500)
|
|
service:
|
|
name: docker
|
|
state: restarted
|
|
|
|
- name: Reset ssh connection to pick up docker group
|
|
meta: reset_connection
|