From 2cab796e15d834dfb9f3743941dd5311731fc70f Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Fri, 17 Jun 2016 10:54:14 -0300 Subject: Normalize some of the version inventory vars which users might mistakenly enter wrong. --- roles/openshift_version/tasks/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'roles') diff --git a/roles/openshift_version/tasks/main.yml b/roles/openshift_version/tasks/main.yml index b11bf62fe..ac3efe7e9 100644 --- a/roles/openshift_version/tasks/main.yml +++ b/roles/openshift_version/tasks/main.yml @@ -11,6 +11,19 @@ msg: "Must specify openshift_release or openshift_image_tag in inventory to install origin. (suggestion: add openshift_release=\"1.2\" to inventory)" when: is_containerized | bool and openshift.common.deployment_type == 'origin' and openshift_release is not defined and openshift_image_tag is not defined +# Normalize some values that we need in a certain format that might be confusing: +- set_fact: + openshift_release: "{{ openshift_release[1:] }}" + when: openshift_release is defined and openshift_release[0] == 'v' + +- set_fact: + openshift_image_tag: "{{ 'v' + openshift_image_tag }}" + when: openshift_image_tag is defined and openshift_image_tag[0] != 'v' + +- set_fact: + openshift_pkg_version: "{{ '-' + openshift_pkg_version }}" + when: openshift_pkg_version is defined and openshift_pkg_version[0] != '-' + # Make sure we copy this to a fact if given a var: - set_fact: openshift_version: "{{ openshift_version }}" -- cgit v1.2.3