12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- ---
- - name: Fail when OpenShift is not installed
- fail:
- msg: Verify OpenShift is already installed
- when: openshift.common.version is not defined
- - name: Verify containers are available for upgrade
- command: >
- docker pull {{ openshift.common.cli_image }}:{{ openshift_image_tag }}
- register: pull_result
- changed_when: "'Downloaded newer image' in pull_result.stdout"
- when: openshift.common.is_containerized | bool
- - when: not openshift.common.is_containerized | bool
- block:
- - name: Check latest available OpenShift RPM version
- repoquery:
- name: "{{ openshift.common.service_type }}"
- ignore_excluders: true
- register: repoquery_out
- - name: Fail when unable to determine available OpenShift RPM version
- fail:
- msg: "Unable to determine available OpenShift RPM version"
- when:
- - not repoquery_out.results.package_found
- - name: Set fact avail_openshift_version
- set_fact:
- avail_openshift_version: "{{ repoquery_out.results.versions.available_versions.0 }}"
- - name: Verify OpenShift RPMs are available for upgrade
- fail:
- msg: "OpenShift {{ avail_openshift_version }} is available, but {{ openshift_upgrade_target }} or greater is required"
- when:
- - avail_openshift_version | default('0.0', True) | version_compare(openshift_release, '<')
- - name: Fail when openshift version does not meet minium requirement for Origin upgrade
- fail:
- msg: "This upgrade playbook must be run against OpenShift {{ openshift_upgrade_min }} or later"
- when:
- - deployment_type == 'origin'
- - openshift.common.version | version_compare(openshift_upgrade_min,'<')
|