Browse Source

Fix installing release 3.1 not converting to precise version.

Devan Goodwin 8 years ago
parent
commit
87cf5935b0

+ 2 - 2
roles/openshift_version/tasks/main.yml

@@ -18,11 +18,11 @@
 
 - name: Set openshift_version for rpm installation
   include: set_version_rpm.yml
-  when: not is_containerized and openshift_version is not defined
+  when: not is_containerized
 
 - name: Set openshift_version for containerized installation
   include: set_version_containerized.yml
-  when: is_containerized and openshift_version is not defined
+  when: is_containerized
 
 - debug: var=openshift_version
 

+ 5 - 1
roles/openshift_version/tasks/set_version_containerized.yml

@@ -2,7 +2,7 @@
 - name: Set containerized version to configure if openshift_image_tag specified
   set_fact:
     openshift_version: "{{ openshift_image_tag.split('v',1)[1] }}"
-  when: openshift_image_tag is defined
+  when: openshift_image_tag is defined and openshift_version is not defined
 
 - name: Set containerized version to configure if openshift_release specified
   set_fact:
@@ -21,6 +21,9 @@
     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: openshift_version is not defined
 
+- debug: msg="{{ openshift_version }}"
+#- debug: var=openshift_version.split('.')
+
 # If we got an openshift_version like "3.2", lookup the latest 3.2 container version
 # and use that value instead.
 - name: Set precise containerized version to configure if openshift_release specified
@@ -32,3 +35,4 @@
 - 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: openshift_version is defined and openshift_version.split('.') | length == 2
+

+ 1 - 1
roles/openshift_version/tasks/set_version_rpm.yml

@@ -5,7 +5,7 @@
     # Expects a leading "-" in inventory, strip it off here, and ignore a trailing release,
     # openshift_version should always just be "3.2" or "3.2.0.44"
     openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
-  when: openshift_pkg_version is defined
+  when: openshift_pkg_version is defined and openshift_version is not defined
 
 # We do not have as fine grained control over version to install presently with rpms,
 # we just assume the user has configured the correct repos and install the rpm requested.