Browse Source

Convert generic openshift_version=3.2 to specific early in install.

Devan Goodwin 8 years ago
parent
commit
c45ccc0ee8
1 changed files with 12 additions and 0 deletions
  1. 12 0
      roles/openshift_docker/tasks/main.yml

+ 12 - 0
roles/openshift_docker/tasks/main.yml

@@ -19,5 +19,17 @@
     openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2][1:] | join('-') if openshift.common.deployment_type == 'origin' else cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
   when: is_containerized | bool and openshift_version is not defined
 
+# If we got an openshift_version like "3.2", lookup the latest 3.2 container version
+# and use that value instead.
+- name: Lookup specific OpenShift version if generic release specified
+  command: >
+    docker run --rm {{ openshift.common.cli_image }}:v{{ openshift_version }} version
+  register: cli_image_version
+  when: is_containerized | bool and openshift_version is defined and openshift_version.split('.') | length == 2
+
+- set_fact:
+    openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2][1:] | join('-') if openshift.common.deployment_type == 'origin' else cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
+  when: is_containerized | bool and openshift_version is defined and openshift_version.split('.') | length == 2
+
 - debug: var=openshift_version