From 7b77e2d2323bfeb93f373489fe268041de4b7902 Mon Sep 17 00:00:00 2001 From: Florent Monbillard Date: Mon, 29 Apr 2019 04:42:22 -0400 Subject: [PATCH] Remove docker-storage-setup dependency if not needed (#4077) When docker_container_storage_setup is false, docker service should not depend on docker-storage-setup service, because it's not installed. For example, when using overlay2 on recent RHEL 7/Centos 7 kernels, you most likely don't need it. --- roles/container-engine/docker/templates/docker.service.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/container-engine/docker/templates/docker.service.j2 b/roles/container-engine/docker/templates/docker.service.j2 index c9a879659..2e259f87b 100644 --- a/roles/container-engine/docker/templates/docker.service.j2 +++ b/roles/container-engine/docker/templates/docker.service.j2 @@ -2,8 +2,8 @@ Description=Docker Application Container Engine Documentation=http://docs.docker.com {% if ansible_os_family == "RedHat" %} -After=network.target docker-storage-setup.service{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} -Wants=docker-storage-setup.service +After=network.target {{ ' docker-storage-setup.service' if docker_container_storage_setup else '' }}{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} +{{ 'Wants=docker-storage-setup.service' if docker_container_storage_setup else '' }} {% elif ansible_os_family == "Debian" %} After=network.target docker.socket{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} Wants=docker.socket