summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks/main.yml
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-04-14 15:39:31 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-04-14 15:39:31 -0400
commitb9099c18e7405f208b81d5969112dd71da100c5b (patch)
tree42847b92b2aa2b37df1d9ceaf59c57f08a29d36a /roles/docker/tasks/main.yml
parentee3f0205333840e18c4796e53b0f061fec666333 (diff)
parent68535500e00aa9b5f349f6055f63082556c0ea30 (diff)
downloadopenshift-b9099c18e7405f208b81d5969112dd71da100c5b.tar.gz
openshift-b9099c18e7405f208b81d5969112dd71da100c5b.tar.bz2
openshift-b9099c18e7405f208b81d5969112dd71da100c5b.tar.xz
openshift-b9099c18e7405f208b81d5969112dd71da100c5b.zip
Merge pull request #1752 from sdodson/docker-reset
Enable docker before potentially resetting the failure
Diffstat (limited to 'roles/docker/tasks/main.yml')
-rw-r--r--roles/docker/tasks/main.yml18
1 files changed, 15 insertions, 3 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 89648b321..f06e4875b 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -24,17 +24,29 @@
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.
+- name: Start the docker service
+ service:
+ name: docker
+ enabled: yes
+ state: started
+ register: start_result
+ ignore_errors: yes
+
+# If docker were enabled and started before we downgraded it there's a real possibility
+# that it's marked failed, so if our first attempt to start it fails reset the failure
+# and start it again.
- name: Reset docker service state
command: systemctl reset-failed docker.service
+ when: start_result | failed
+ register: reset_failed
-- name: enable and start the docker service
+- name: Start the docker service if it had failed
service:
name: docker
enabled: yes
state: started
register: start_result
+ when: reset_failed | changed
- set_fact:
docker_service_status_changed: start_result | changed