set_version_rpm.yml 866 B

123456789101112131415161718192021222324
  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 remove 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 and openshift_version is not defined
  9. - debug: var=openshift_version
  10. - name: Gather common package version
  11. command: >
  12. {{ repoquery_cmd }} --qf '%{version}' "{{ openshift.common.service_type}}"
  13. register: common_version
  14. failed_when: false
  15. changed_when: false
  16. when: openshift_version is not defined
  17. - debug: var=common_version
  18. - set_fact:
  19. openshift_version: "{{ common_version.stdout | default('0.0', True) }}"
  20. when: openshift_version is not defined