summaryrefslogtreecommitdiffstats
path: root/roles/docker/tasks
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-04-14 11:22:35 -0400
committerScott Dodson <sdodson@redhat.com>2016-04-14 12:52:38 -0400
commit037a48562d5bcd152556d2068b14663b99ef46ef (patch)
tree256cdff8ebccea260b0cd4ec824336ed6bf78430 /roles/docker/tasks
parent40d95679b7b789e404d39c5642753a1ad2307adf (diff)
downloadopenshift-037a48562d5bcd152556d2068b14663b99ef46ef.tar.gz
openshift-037a48562d5bcd152556d2068b14663b99ef46ef.tar.bz2
openshift-037a48562d5bcd152556d2068b14663b99ef46ef.tar.xz
openshift-037a48562d5bcd152556d2068b14663b99ef46ef.zip
Enable docker before potentially resetting the failure
Diffstat (limited to 'roles/docker/tasks')
-rw-r--r--roles/docker/tasks/main.yml11
1 files changed, 10 insertions, 1 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 89648b321..b15c1004e 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -24,12 +24,21 @@
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')
+# Enable docker and record if it was changed, if it was changed then we have no
+# need to reset-failed.
+- name: Enable the docker service
+ service:
+ name: docker
+ enabled: yes
+ register: docker_enabled
+
# 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: Reset docker service state
command: systemctl reset-failed docker.service
+ when: not docker_enabled | changed
-- name: enable and start the docker service
+- name: Start the docker service
service:
name: docker
enabled: yes