summaryrefslogtreecommitdiffstats
path: root/roles/openshift_version/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_version/tasks/main.yml')
-rw-r--r--roles/openshift_version/tasks/main.yml38
1 files changed, 38 insertions, 0 deletions
diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml
new file mode 100644
index 000000000..29724a9e5
--- /dev/null
+++ b/roles/openshift_version/tasks/main.yml
@@ -0,0 +1,38 @@
+---
+# Determine the openshift_version to configure if none has been specified or set previously.
+
+- set_fact:
+ is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}"
+
+# Make sure we copy this to a fact if given a var:
+- set_fact:
+ openshift_version: "{{ openshift_version }}"
+ when: openshift_version is defined
+
+- debug: var=openshift_version
+- debug: var=openshift_release
+- debug: var=openshift_pkg_version
+- debug: var=openshift_image_tag
+
+# Protect the installed version by default unless explicitly told not to, or given an
+# openshift_version already.
+- name: Use openshift.common.version fact as version to configure if already installed
+ set_fact:
+ openshift_version: "{{ openshift.common.version }}"
+ when: openshift.common.version is defined and openshift_version is not defined and openshift_protect_installed_version
+
+- name: Set openshift_version for rpm installation
+ include: set_version_rpm.yml
+ when: not is_containerized
+
+- name: Set openshift_version for containerized installation
+ include: set_version_containerized.yml
+ when: is_containerized
+
+- 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.
+