1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- ---
- - name: Fail when OpenShift is not installed
- fail:
- msg: Verify OpenShift is already installed
- when: openshift.common.version is not defined
- - name: Update oreg_auth docker login credentials if necessary
- include_role:
- name: container_runtime
- tasks_from: registry_auth.yml
- when: oreg_auth_user is defined
- - name: Verify containers are available for upgrade
- command: >
- docker pull {{ openshift_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_full.0 }}"
- - name: Set openshift_pkg_version when not specified
- set_fact:
- openshift_pkg_version: "-{{ repoquery_out.results.versions.available_versions_full.0 }}"
- when: openshift_pkg_version | default('') == ''
- - 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:
- - (openshift_pkg_version | default('-0.0', True)).split('-')[1] | 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,'<')
|