blob: 2ab31de8b1510d9afd0b5dd7acda72cf9771c71f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
---
# It's important that we don't explicitly pull this image here. Otherwise we
# could result in upgrading a preinstalled environment. We'll have to set
# openshift_image_tag correctly for upgrades.
- set_fact:
is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}"
# If no openshift_version provided, figure out what to use:
# TODO: May want to move this to another role.
- name: Lookup latest OpenShift version if none specified
command: >
docker run --rm {{ openshift.common.cli_image }}:latest version
register: cli_image_version
when: is_containerized | bool and openshift_version is not defined
- debug: var=cli_image_version
- set_fact:
openshift_version: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2][1:] | join('-') if openshift.common.deployment_type == 'origin' else cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0][1:] }}"
when: is_containerized | bool and openshift_version is not defined
- debug: var=openshift_version
|