summaryrefslogtreecommitdiffstats
path: root/roles/openshift_version
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_version')
-rw-r--r--roles/openshift_version/tasks/main.yml24
-rw-r--r--roles/openshift_version/tasks/set_version_containerized.yml4
-rw-r--r--roles/openshift_version/tasks/set_version_rpm.yml2
3 files changed, 26 insertions, 4 deletions
diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml
index e27add09e..d896eb151 100644
--- a/roles/openshift_version/tasks/main.yml
+++ b/roles/openshift_version/tasks/main.yml
@@ -31,10 +31,30 @@
include: set_version_containerized.yml
when: is_containerized | bool
-- debug: var=openshift_version
-
# At this point we know openshift_version is set appropriately. Now we set
# openshift_image_tag and openshift_pkg_version, so all roles can always assume
# each of this variables *will* be set correctly and can use them per their
# intended purpose.
+- set_fact:
+ openshift_image_tag: v{{ openshift_version }}
+ when: openshift_image_tag is not defined
+
+- set_fact:
+ openshift_pkg_version: -{{ openshift_version }}
+ when: openshift_pkg_version is not defined
+
+# TODO: fail if any of these is unset or looks wrong:
+- debug: var=openshift_version
+- debug: var=openshift_pkg_version
+- debug: var=openshift_image_tag
+
+- fail: openshift_version role was unable to set openshift_version
+ when: openshift_version is not defined
+
+- fail: openshift_version role was unable to set openshift_image_tag
+ when: openshift_image_tag is not defined
+
+- fail: openshift_version role was unable to set openshift_pkg_version
+ when: openshift_pkg_version is not defined
+
diff --git a/roles/openshift_version/tasks/set_version_containerized.yml b/roles/openshift_version/tasks/set_version_containerized.yml
index fc15b2d35..6d31d0ddc 100644
--- a/roles/openshift_version/tasks/set_version_containerized.yml
+++ b/roles/openshift_version/tasks/set_version_containerized.yml
@@ -1,7 +1,9 @@
---
- name: Set containerized version to configure if openshift_image_tag specified
set_fact:
- openshift_version: "{{ openshift_image_tag.split('v',1)[1] }}"
+ # Expects a leading "v" in inventory, strip it off here:
+ # openshift_version should always just be "3.2" or "3.2.0.44"
+ openshift_version: "{{ openshift_image_tag[1:].split('-')[0] }}"
when: openshift_image_tag is defined and openshift_version is not defined
- name: Set containerized version to configure if openshift_release specified
diff --git a/roles/openshift_version/tasks/set_version_rpm.yml b/roles/openshift_version/tasks/set_version_rpm.yml
index b15f0e993..90229b0e9 100644
--- a/roles/openshift_version/tasks/set_version_rpm.yml
+++ b/roles/openshift_version/tasks/set_version_rpm.yml
@@ -2,7 +2,7 @@
# TODO: support openshift_release here?
- name: Set rpm version to configure if openshift_pkg_version specified
set_fact:
- # Expects a leading "-" in inventory, strip it off here, and ignore a trailing release,
+ # Expects a leading "-" in inventory, strip it off here, and remove 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 and openshift_version is not defined