summaryrefslogtreecommitdiffstats
path: root/roles/docker
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-04-12 17:07:01 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-04-12 17:07:01 -0400
commit7967d127716de50f63dca9bd137f43ab642770bf (patch)
treef8d4826c58fff02dd7e1e24bccbee2ba79ab4a54 /roles/docker
parentdf44d99957b9d44bf9d221b224a46865c3224d2c (diff)
parent0879620498b1251f3a375b9a5657c16dd571906a (diff)
downloadopenshift-7967d127716de50f63dca9bd137f43ab642770bf.tar.gz
openshift-7967d127716de50f63dca9bd137f43ab642770bf.tar.bz2
openshift-7967d127716de50f63dca9bd137f43ab642770bf.tar.xz
openshift-7967d127716de50f63dca9bd137f43ab642770bf.zip
Merge pull request #1718 from brenton/docker1
Containerized installs on RHEL were downgrading docker unnecessarily
Diffstat (limited to 'roles/docker')
-rw-r--r--roles/docker/tasks/main.yml23
1 files changed, 14 insertions, 9 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 1d8493938..89648b321 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -7,22 +7,27 @@
register: docker_version_result
changed_when: false
+- stat: path=/etc/sysconfig/docker-storage
+ register: docker_storage_check
+
+- name: Remove deferred deletion for downgrades from 1.9
+ command: >
+ sed -i 's/--storage-opt dm.use_deferred_deletion=true//' /etc/sysconfig/docker-storage
+ when: docker_storage_check.stat.exists | bool and not docker_version_result | skipped and docker_version_result.stdout | default('0.0', True) | version_compare('1.9', '>=') and docker_version | version_compare('1.9', '<')
+
- name: Downgrade docker if necessary
command: "{{ ansible_pkg_mgr }} downgrade -y docker-{{ docker_version }}"
register: docker_downgrade_result
when: not docker_version_result | skipped and docker_version_result.stdout | default('0.0', True) | version_compare(docker_version, 'gt')
- name: Install docker
- action: "{{ ansible_pkg_mgr }} name=docker{{ '-' + docker_version if docker_version != '' else '' }} state=present"
- when: not openshift.common.is_atomic | bool and not docker_downgrade_result | changed
+ 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')
-- stat: path=/etc/sysconfig/docker-storage
- register: docker_storage_check
-
-- name: Remove deferred deletion for downgrades from 1.9
- command: >
- sed -i 's/--storage-opt dm.use_deferred_deletion=true//' /etc/sysconfig/docker-storage
- when: docker_downgrade_result | changed and docker_storage_check.stat.exists | bool and docker_version_result.stdout | default('0.0', True) | version_compare('1.9', '>=') and docker_version | version_compare('1.9', '<')
+# 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
- name: enable and start the docker service
service: