summaryrefslogtreecommitdiffstats
path: root/roles/openshift_docker_facts
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-03-23 15:09:51 -0400
committerScott Dodson <sdodson@redhat.com>2016-04-05 12:45:53 -0400
commit18b52f2c4ef11b34b248b48ce5ca59d7c5a4f426 (patch)
treeb67dddfa41b36636f6a628894b97ccbb719aabd2 /roles/openshift_docker_facts
parent9db67b8095b206efefeb2c3def07e1e4394733d0 (diff)
downloadopenshift-18b52f2c4ef11b34b248b48ce5ca59d7c5a4f426.tar.gz
openshift-18b52f2c4ef11b34b248b48ce5ca59d7c5a4f426.tar.bz2
openshift-18b52f2c4ef11b34b248b48ce5ca59d7c5a4f426.tar.xz
openshift-18b52f2c4ef11b34b248b48ce5ca59d7c5a4f426.zip
Downgrade to docker 1.8.2 if installing OSE < 3.2
Diffstat (limited to 'roles/openshift_docker_facts')
-rw-r--r--roles/openshift_docker_facts/tasks/main.yml16
-rw-r--r--roles/openshift_docker_facts/vars/main.yml2
2 files changed, 18 insertions, 0 deletions
diff --git a/roles/openshift_docker_facts/tasks/main.yml b/roles/openshift_docker_facts/tasks/main.yml
index 26b46aa94..1848619e0 100644
--- a/roles/openshift_docker_facts/tasks/main.yml
+++ b/roles/openshift_docker_facts/tasks/main.yml
@@ -37,3 +37,19 @@
- set_fact:
docker_options: "{{ openshift.docker.options | default(omit) }}"
when: not openshift.docker.hosted_registry_insecure | default(False) | bool
+
+# 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: Gather common package version
+ command: >
+ {{ repoquery_cmd }} --qf '%{version}' "{{ openshift.common.service_type}}"
+ register: common_version
+ failed_when: false
+ changed_when: false
+ when: not openshift.common.is_atomic | bool
+
+- name: Set docker version to be installed
+ set_fact:
+ docker_version: "{{ '1.8.2' }}"
+ when: " ( common_version.stdout | default('0.0', True) | version_compare('3.2','<') and openshift.common.service_type == 'atomic-openshift' ) or
+ ( common_version.stdout | default('0.0', True) | version_compare('1.2','<') and openshift.common.service_type == 'origin' )"
diff --git a/roles/openshift_docker_facts/vars/main.yml b/roles/openshift_docker_facts/vars/main.yml
new file mode 100644
index 000000000..f7ad1b329
--- /dev/null
+++ b/roles/openshift_docker_facts/vars/main.yml
@@ -0,0 +1,2 @@
+---
+repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery' }}"