diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-07-14 18:49:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-14 18:49:24 -0400 |
commit | 65ffae3e6edc8902c591dfef792a505a16029698 (patch) | |
tree | a28948529ce2a4c8b700aaf5352173be1aea8f8a /roles/openshift_docker | |
parent | 1a6b1bf010b661feb8495d4088f9a0f2640b5658 (diff) | |
parent | 03f31fdc581eea090388b5a60b3818167eb47c0c (diff) | |
download | openshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.gz openshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.bz2 openshift-65ffae3e6edc8902c591dfef792a505a16029698.tar.xz openshift-65ffae3e6edc8902c591dfef792a505a16029698.zip |
Merge pull request #1945 from dgoodwin/upgrade33
openshift_release / version / upgrade improvements
Diffstat (limited to 'roles/openshift_docker')
-rw-r--r-- | roles/openshift_docker/defaults/main.yml | 1 | ||||
-rw-r--r-- | roles/openshift_docker/meta/main.yml | 2 | ||||
-rw-r--r-- | roles/openshift_docker/tasks/main.yml | 40 |
3 files changed, 1 insertions, 42 deletions
diff --git a/roles/openshift_docker/defaults/main.yml b/roles/openshift_docker/defaults/main.yml index aebef75d6..ed97d539c 100644 --- a/roles/openshift_docker/defaults/main.yml +++ b/roles/openshift_docker/defaults/main.yml @@ -1,2 +1 @@ --- -upgrading: False diff --git a/roles/openshift_docker/meta/main.yml b/roles/openshift_docker/meta/main.yml index d98f953ea..10131f717 100644 --- a/roles/openshift_docker/meta/main.yml +++ b/roles/openshift_docker/meta/main.yml @@ -12,6 +12,6 @@ galaxy_info: categories: - cloud dependencies: -- role: openshift_repos +- role: openshift_version - role: openshift_docker_facts - role: docker diff --git a/roles/openshift_docker/tasks/main.yml b/roles/openshift_docker/tasks/main.yml index 9c5887f76..ed97d539c 100644 --- a/roles/openshift_docker/tasks/main.yml +++ b/roles/openshift_docker/tasks/main.yml @@ -1,41 +1 @@ --- -# 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 }}" - # 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 }}" - -- name: Set version when containerized - command: > - docker run --rm {{ openshift.common.cli_image }} version - register: cli_image_version - when: is_containerized | bool and openshift_image_tag is not defined and (upgrading | bool or not has_image_tag_fact | bool) - -# Use the pre-existing image tag from system facts if present, and we're not upgrading. -# Ignores explicit openshift_image_tag if it's in the inventory, as this isn't an upgrade. -- set_fact: - l_image_tag: "{{ hostvars[inventory_hostname].openshift.docker.openshift_image_tag }}" - when: is_containerized | bool and not upgrading | bool and has_image_tag_fact | bool - -- set_fact: - l_image_tag: "{{ cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0:2] | join('-') if openshift.common.deployment_type == 'origin' else - cli_image_version.stdout_lines[0].split(' ')[1].split('-')[0] }}" - when: is_containerized | bool and openshift_image_tag is not defined and (upgrading | bool or not has_image_tag_fact | bool) - -- set_fact: - l_image_tag: "{{ openshift_image_tag }}" - when: is_containerized | bool and openshift_image_tag is defined and (upgrading | bool or not has_image_tag_fact | bool) - -- name: Set post docker install facts - openshift_facts: - role: "{{ item.role }}" - local_facts: "{{ item.local_facts }}" - with_items: - - role: docker - local_facts: - openshift_image_tag: "{{ l_image_tag | default(None) }}" - openshift_version: "{{ l_image_tag.split('-')[0] | oo_image_tag_to_rpm_version if l_image_tag is defined else '' }}" - when: is_containerized | bool |