summaryrefslogtreecommitdiffstats
path: root/ansible
diff options
context:
space:
mode:
authorMichal Ptacek <m.ptacek@partner.samsung.com>2019-03-27 15:05:44 +0000
committerMichal Ptacek <m.ptacek@partner.samsung.com>2019-03-28 08:14:34 +0000
commitcc1c010e69df78ff74fc4f36f10fb669624ded25 (patch)
treee7593a5188aeee4916402d1bf00b540eadef727f /ansible
parent98ea82804e23245082f2a7b9363ea5b10300329a (diff)
Improving docker restart handler
There is a bug in docker which leads to not properly shutdown service preventing subsequent startup. https://github.com/moby/moby/issues/30348 This commit is preventing this problem to appear. Change-Id: I29505610bd9954af01d73264e5414fdb2b9ac99d Issue-ID: OOM-1735 Signed-off-by: Michal Ptacek <m.ptacek@partner.samsung.com>
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/docker/handlers/docker_restart.yml18
-rw-r--r--ansible/roles/docker/handlers/main.yml5
2 files changed, 19 insertions, 4 deletions
diff --git a/ansible/roles/docker/handlers/docker_restart.yml b/ansible/roles/docker/handlers/docker_restart.yml
new file mode 100644
index 00000000..8feb9a95
--- /dev/null
+++ b/ansible/roles/docker/handlers/docker_restart.yml
@@ -0,0 +1,18 @@
+---
+- name: Stopping docker systemd service
+ systemd:
+ name: docker
+ state: stopped
+ enabled: true
+
+# WA for docker bug, see OOM-1735
+- name: Ensure docker.sock cleaned properly
+ file:
+ state: absent
+ path: /var/run/docker.sock
+
+- name: Starting docker systemd service
+ systemd:
+ name: docker
+ state: started
+ enabled: true
diff --git a/ansible/roles/docker/handlers/main.yml b/ansible/roles/docker/handlers/main.yml
index 5df47e8d..de4a52ac 100644
--- a/ansible/roles/docker/handlers/main.yml
+++ b/ansible/roles/docker/handlers/main.yml
@@ -1,6 +1,3 @@
---
- name: Restart Docker
- systemd:
- name: docker
- state: restarted
- enabled: yes
+ import_tasks: docker_restart.yml