summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/docker/tasks/main.yml12
1 files changed, 9 insertions, 3 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 89648b321..878d5fea8 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -24,12 +24,18 @@
action: "{{ ansible_pkg_mgr }} name=docker{{ '-' + docker_version if docker_version is defined and docker_version != '' else '' }} state=present"
when: not openshift.common.is_atomic | bool and not docker_version_result | skipped and docker_version_result.stdout | default('0.0', True) | version_compare(docker_version, 'lt')
-# We're getting ready to start docker. This is a workaround for cases where it
-# seems a package install/upgrade/downgrade has rebooted docker and crashed it.
+# If docker were enabled and started before we downgraded it may have entered a
+# failed state. Check for that and clear it if necessary.
+- name: Check that docker hasn't entered failed state
+ command: systemctl show docker
+ register: docker_state
+ changed_when: False
+
- name: Reset docker service state
command: systemctl reset-failed docker.service
+ when: " 'ActiveState=failed' in docker_state.stdout "
-- name: enable and start the docker service
+- name: Start the docker service
service:
name: docker
enabled: yes