---
- name: Set rpm version to configure if openshift_pkg_version specified
  set_fact:
    # Expects a leading "-" in inventory, strip it off here, and remove trailing release,
    openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
  when:
  - openshift_pkg_version is defined
  - openshift_version is not defined

# These tasks should only be run against masters and nodes
- name: Set openshift_version for rpm installation
  include_tasks: check_available_rpms.yml

# If double upgrade is in process, we want to set openshift_version to whatever
# rpm package is available.
- set_fact:
    openshift_version: "{{ rpm_results.results.versions.available_versions.0 }}"
  when: openshift_version is not defined or l_double_upgrade_cp_reset_version
