summaryrefslogtreecommitdiffstats
path: root/roles/docker
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2016-03-15 08:40:25 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2016-03-15 08:40:25 -0400
commit28e470b4e6bb526a489aba65e875ac4672e279e2 (patch)
treed2c6b78025c8b39c4bbd01b5a29d6361aae98f93 /roles/docker
parent3f89e247c1e1e200567a69f7c41a24ac345440e9 (diff)
parent15ff077c5b2fc622c749c96ceea707aef13d7470 (diff)
downloadopenshift-28e470b4e6bb526a489aba65e875ac4672e279e2.tar.gz
openshift-28e470b4e6bb526a489aba65e875ac4672e279e2.tar.bz2
openshift-28e470b4e6bb526a489aba65e875ac4672e279e2.tar.xz
openshift-28e470b4e6bb526a489aba65e875ac4672e279e2.zip
Merge pull request #1600 from sdodson/docker182
OSE/Origin < 3.2/1.2 should not get Docker 1.9
Diffstat (limited to 'roles/docker')
-rw-r--r--roles/docker/tasks/main.yml26
1 files changed, 25 insertions, 1 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index 4164a9ec0..506cecfea 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -1,7 +1,31 @@
---
# tasks file for docker
+
+# Avoid docker 1.9 when installing origin < 1.2 or OSE < 3.2 on RHEL/Centos and
+# See: https://bugzilla.redhat.com/show_bug.cgi?id=1304038
+
+- name: Default to latest docker for 1.2/3.2 or Fedora
+ set_fact:
+ docker_version: ''
+ when: openshift.common.version_gte_3_2_or_1_2 | bool or ansible_distribution == 'Fedora'
+
+- name: Gather latest version of docker
+ shell: >
+ yum list available -e 0 -q "docker" 2>&1 | tail -n +2 | awk '{ print $2 }' | sort -r | tr '\n' ' ' | tail -n 1
+ register: latest_docker
+ when: not openshift.common.version_gte_3_2_or_1_2 | bool and ansible_distribution != 'Fedora'
+
+- name: Check if Docker 1.9 is the latest
+ set_fact:
+ docker19_is_latest: "{{ True if '1.9' in latest_docker.stdout else False }}"
+ when: not openshift.common.version_gte_3_2_or_1_2 | bool and ansible_distribution != 'Fedora'
+
+- set_fact:
+ docker_version: "{{ '-1.8.2' if docker19_is_latest | bool else ''}}"
+ when: not openshift.common.version_gte_3_2_or_1_2 | bool and ansible_distribution != 'Fedora'
+
- name: Install docker
- action: "{{ ansible_pkg_mgr }} name=docker state=present"
+ action: "{{ ansible_pkg_mgr }} name=docker{{ docker_version }} state=present"
when: not openshift.common.is_atomic | bool
- name: enable and start the docker service