Browse Source

Fix openshift_image_tag=latest.

Andrew Butcher 8 years ago
parent
commit
4186b4742b

+ 2 - 2
roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_predicates.py

@@ -40,10 +40,10 @@ class LookupModule(LookupBase):
                 # pylint: disable=line-too-long
                 raise AnsibleError("Either OpenShift needs to be installed or openshift_release needs to be specified")
         if deployment_type == 'origin':
-            if short_version not in ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6']:
+            if short_version not in ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6', 'latest']:
                 raise AnsibleError("Unknown short_version %s" % short_version)
         elif deployment_type == 'openshift-enterprise':
-            if short_version not in ['3.1', '3.2', '3.3', '3.4', '3.5', '3.6']:
+            if short_version not in ['3.1', '3.2', '3.3', '3.4', '3.5', '3.6', 'latest']:
                 raise AnsibleError("Unknown short_version %s" % short_version)
         else:
             raise AnsibleError("Unknown deployment_type %s" % deployment_type)

+ 2 - 2
roles/openshift_master_facts/lookup_plugins/openshift_master_facts_default_priorities.py

@@ -45,10 +45,10 @@ class LookupModule(LookupBase):
                 raise AnsibleError("Either OpenShift needs to be installed or openshift_release needs to be specified")
 
         if deployment_type == 'origin':
-            if short_version not in ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6']:
+            if short_version not in ['1.1', '1.2', '1.3', '1.4', '1.5', '1.6', 'latest']:
                 raise AnsibleError("Unknown short_version %s" % short_version)
         elif deployment_type == 'openshift-enterprise':
-            if short_version not in ['3.1', '3.2', '3.3', '3.4', '3.5', '3.6']:
+            if short_version not in ['3.1', '3.2', '3.3', '3.4', '3.5', '3.6', 'latest']:
                 raise AnsibleError("Unknown short_version %s" % short_version)
         else:
             raise AnsibleError("Unknown deployment_type %s" % deployment_type)

+ 3 - 2
roles/openshift_version/tasks/set_version_containerized.yml

@@ -1,8 +1,9 @@
 ---
 - name: Set containerized version to configure if openshift_image_tag specified
   set_fact:
-    # Expects a leading "v" in inventory, strip it off here:
-    openshift_version: "{{ openshift_image_tag[1:].split('-')[0] }}"
+    # Expects a leading "v" in inventory, strip it off here unless
+    # openshift_image_tag=latest
+    openshift_version: "{{ openshift_image_tag[1:].split('-')[0] if openshift_image_tag != 'latest' else openshift_image_tag }}"
   when: openshift_image_tag is defined and openshift_version is not defined
 
 - name: Set containerized version to configure if openshift_release specified