From c19d8994b9cae800806dd7d0c7b3aeecee11d866 Mon Sep 17 00:00:00 2001 From: Chris Mildebrandt Date: Tue, 20 Feb 2018 11:55:13 -0800 Subject: [PATCH 1/2] Set TasksMax to infinity on any OS with systemd --- roles/docker/tasks/systemd.yml | 4 ++-- roles/docker/templates/docker.service.j2 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/docker/tasks/systemd.yml b/roles/docker/tasks/systemd.yml index 90425fed2..877de1299 100644 --- a/roles/docker/tasks/systemd.yml +++ b/roles/docker/tasks/systemd.yml @@ -12,9 +12,9 @@ when: http_proxy is defined or https_proxy is defined - name: get systemd version - command: rpm -q --qf '%{V}\n' systemd + command: systemctl --version | head -n 1 | cut -d " " -f 2 register: systemd_version - when: ansible_os_family == "RedHat" and not is_atomic + when: not is_atomic changed_when: false - name: Write docker.service systemd file diff --git a/roles/docker/templates/docker.service.j2 b/roles/docker/templates/docker.service.j2 index 73c4c7e61..ee43c2bd6 100644 --- a/roles/docker/templates/docker.service.j2 +++ b/roles/docker/templates/docker.service.j2 @@ -24,7 +24,7 @@ ExecStart={{ docker_bin_dir }}/docker{% if installed_docker_version.stdout|versi $DOCKER_NETWORK_OPTIONS \ $DOCKER_DNS_OPTIONS \ $INSECURE_REGISTRY -{% if ansible_os_family == "RedHat" and systemd_version.stdout|int >= 226 %} +{% if systemd_version.stdout|int >= 226 %} TasksMax=infinity {% endif %} LimitNOFILE=1048576 From 85c69c2a4ab842fe297ee0168e52ff5b001c6bb4 Mon Sep 17 00:00:00 2001 From: Chris Mildebrandt Date: Wed, 21 Feb 2018 08:26:18 -0800 Subject: [PATCH 2/2] Add check for atomic hosts in template --- 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 ee43c2bd6..29abb6d53 100644 --- a/roles/docker/templates/docker.service.j2 +++ b/roles/docker/templates/docker.service.j2 @@ -24,7 +24,7 @@ ExecStart={{ docker_bin_dir }}/docker{% if installed_docker_version.stdout|versi $DOCKER_NETWORK_OPTIONS \ $DOCKER_DNS_OPTIONS \ $INSECURE_REGISTRY -{% if systemd_version.stdout|int >= 226 %} +{% if not is_atomic and systemd_version.stdout|int >= 226 %} TasksMax=infinity {% endif %} LimitNOFILE=1048576