diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2016-05-24 09:46:33 -0300 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2016-05-25 10:28:32 -0300 |
commit | 0c7433838c8c6409b8de907fcc946fc73fe90527 (patch) | |
tree | 0e0138faf3cb685ac8dd51df79ee25f50c1111b6 /roles/openshift_docker | |
parent | 82a70f9cc1522d239212701ab6c9260cbf9dc8a7 (diff) | |
download | openshift-0c7433838c8c6409b8de907fcc946fc73fe90527.tar.gz openshift-0c7433838c8c6409b8de907fcc946fc73fe90527.tar.bz2 openshift-0c7433838c8c6409b8de907fcc946fc73fe90527.tar.xz openshift-0c7433838c8c6409b8de907fcc946fc73fe90527.zip |
Work towards determining openshift_version when unspecified.
openshift_docker role was largely useless now, but also almost did what
we needed. (deps ordering still needs to be changed)
Remove defaulting of openshift_version.
Diffstat (limited to 'roles/openshift_docker')
-rw-r--r-- | roles/openshift_docker/tasks/main.yml | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml index aaa472727..2ab31de8b 100644 --- a/roles/openshift_docker/tasks/main.yml +++ b/roles/openshift_docker/tasks/main.yml @@ -4,7 +4,20 @@ # openshift_image_tag correctly for upgrades. - set_fact: is_containerized: "{{ openshift.common.is_containerized | default(False) | bool }}" - # Does the host already have an image tag fact, used to determine if it's a new node - # in non-upgrade scenarios: - has_image_tag_fact: "{{ hostvars[inventory_hostname].openshift.docker.openshift_image_tag is defined }}" + +# 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 |