set_version_rpm.yml 1.1 KB

1234567891011121314151617181920212223
  1. ---
  2. # TODO: support openshift_release here?
  3. - name: Set rpm version to configure if openshift_pkg_version specified
  4. set_fact:
  5. # Expects a leading "-" in inventory, strip it off here, and ignore a trailing release,
  6. # openshift_version should always just be "3.2" or "3.2.0.44"
  7. openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
  8. when: openshift_pkg_version is defined
  9. # We do not have as fine grained control over version to install presently with rpms,
  10. # we just assume the user has configured the correct repos and install the rpm requested.
  11. - name: Install latest rpm available in configured repos to check version
  12. action: "{{ ansible_pkg_mgr }} name={{ openshift.common.service_type }}{{ openshift_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }} state=present"
  13. when: openshift_version is not defined
  14. - name: Reload facts to pick up version
  15. openshift_facts:
  16. when: openshift_version is not defined
  17. - name: Set rpm version to configure to latest available in repos
  18. set_fact:
  19. openshift_version: "{{ openshift.common.version }}"
  20. when: openshift_version is not defined