|
@@ -1,57 +0,0 @@
|
|
|
----
|
|
|
-- name: Set containerized version to configure if openshift_image_tag specified
|
|
|
- set_fact:
|
|
|
- # 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
|
|
|
- - openshift_version is not defined
|
|
|
-
|
|
|
-- name: Set containerized version to configure if openshift_release specified
|
|
|
- set_fact:
|
|
|
- openshift_version: "{{ openshift_release }}"
|
|
|
- when:
|
|
|
- - openshift_release is defined
|
|
|
- - openshift_version is not defined
|
|
|
-
|
|
|
-- name: Lookup latest containerized version if no version specified
|
|
|
- command: >
|
|
|
- docker run --rm {{ openshift_cli_image }}:latest version
|
|
|
- register: cli_image_version
|
|
|
- when:
|
|
|
- - openshift_version is not defined
|
|
|
- - not openshift_use_crio_only
|
|
|
-
|
|
|
-# Origin latest = pre-release version (i.e. v1.3.0-alpha.1-321-gb095e3a)
|
|
|
-- set_fact:
|
|
|
- openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
|
|
|
- when: openshift_version is not defined
|
|
|
-
|
|
|
-# If we got an openshift_version like "3.2", lookup the latest 3.2 container version
|
|
|
-# and use that value instead.
|
|
|
-- name: Set precise containerized version to configure if openshift_release specified
|
|
|
- command: >
|
|
|
- docker run --rm {{ openshift_cli_image }}:v{{ openshift_version }} version
|
|
|
- register: cli_image_version
|
|
|
- when:
|
|
|
- - openshift_version is defined
|
|
|
- - openshift_version.split('.') | length == 2
|
|
|
- - not openshift_use_crio_only
|
|
|
-
|
|
|
-- set_fact:
|
|
|
- openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
|
|
|
- when:
|
|
|
- - openshift_version is defined
|
|
|
- - openshift_version.split('.') | length == 2
|
|
|
- - not openshift_use_crio_only
|
|
|
-
|
|
|
-# TODO: figure out a way to check for the openshift_version when using CRI-O.
|
|
|
-# We should do that using the images in the ostree storage so we don't have
|
|
|
-# to pull them again.
|
|
|
-
|
|
|
-# We finally have the specific version. Now we clean up any strange
|
|
|
-# dangly +c0mm1t-offset tags in the version. See also,
|
|
|
-# openshift_facts.py
|
|
|
-- set_fact:
|
|
|
- openshift_version: "{{ openshift_version | lib_utils_oo_chomp_commit_offset }}"
|