From c3ec3ff902b9bc55433f02c113df97c02c669365 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Wed, 7 Dec 2016 17:18:41 +0100 Subject: [PATCH 1/2] Allow to specify docker storage driver --- inventory/group_vars/all.yml | 4 ++++ roles/docker/templates/docker.service.j2 | 3 +++ 2 files changed, 7 insertions(+) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index f64cab5aa..849fae574 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -157,6 +157,10 @@ docker_daemon_graph: "/var/lib/docker" ## to self hosted registries like so: docker_options: "--insecure-registry={{ kube_service_addresses }} --graph={{ docker_daemon_graph }}" +## Uncomment this if you want to force overlay/overlay2 as docker storage driver +## Please note that overlay2 is only supported on newer kernels +#docker_storage_options: -s overlay2 + # K8s image pull policy (imagePullPolicy) k8s_image_pull_policy: IfNotPresent diff --git a/roles/docker/templates/docker.service.j2 b/roles/docker/templates/docker.service.j2 index 60ab22194..584557cee 100644 --- a/roles/docker/templates/docker.service.j2 +++ b/roles/docker/templates/docker.service.j2 @@ -11,6 +11,9 @@ Wants=docker.socket [Service] Type=notify +{% if docker_storage_options is defined %} +Environment="DOCKER_STORAGE_OPTIONS={{docker_storage_options}}" +{% endif %} Environment=GOTRACEBACK=crash ExecReload=/bin/kill -s HUP $MAINPID Delegate=yes From 8a5ba6b20c847a250831d032df8e22b94057b892 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Fri, 9 Dec 2016 13:56:51 +0100 Subject: [PATCH 2/2] Use proper style (spacing) for docker_storage_options --- roles/docker/templates/docker.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/docker/templates/docker.service.j2 b/roles/docker/templates/docker.service.j2 index 584557cee..39e460e96 100644 --- a/roles/docker/templates/docker.service.j2 +++ b/roles/docker/templates/docker.service.j2 @@ -12,7 +12,7 @@ Wants=docker.socket [Service] Type=notify {% if docker_storage_options is defined %} -Environment="DOCKER_STORAGE_OPTIONS={{docker_storage_options}}" +Environment="DOCKER_STORAGE_OPTIONS={{ docker_storage_options }}" {% endif %} Environment=GOTRACEBACK=crash ExecReload=/bin/kill -s HUP $MAINPID