diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-14 09:06:39 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-06-15 09:50:01 -0300 |
commit | a836a35b63ff1476eca5a8545a6c11ab389026d0 (patch) | |
tree | efb2a8e15e4464fc07e573d83c5f8a3d73f77251 /roles/openshift_version | |
parent | 04643670db5709358fe55916705a9ce15ff0bb1e (diff) | |
download | openshift-a836a35b63ff1476eca5a8545a6c11ab389026d0.tar.gz openshift-a836a35b63ff1476eca5a8545a6c11ab389026d0.tar.bz2 openshift-a836a35b63ff1476eca5a8545a6c11ab389026d0.tar.xz openshift-a836a35b63ff1476eca5a8545a6c11ab389026d0.zip |
Always populate openshift_image_tag and openshift_pkg_version.
Allows the use of arbitrary tags, precise control over containers and
rpms, and likely mixed environments.
Diffstat (limited to 'roles/openshift_version')
-rw-r--r-- | roles/openshift_version/tasks/main.yml | 24 | ||||
-rw-r--r-- | roles/openshift_version/tasks/set_version_containerized.yml | 4 | ||||
-rw-r--r-- | roles/openshift_version/tasks/set_version_rpm.yml | 2 |
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 |