set_version_rpm.yml 797 B

123456789101112131415161718192021222324
  1. ---
  2. - name: Set rpm version to configure if openshift_pkg_version specified
  3. set_fact:
  4. # Expects a leading "-" in inventory, strip it off here, and remove trailing release,
  5. openshift_version: "{{ openshift_pkg_version[1:].split('-')[0] }}"
  6. when:
  7. - openshift_pkg_version is defined
  8. - openshift_version is not defined
  9. - block:
  10. - name: Get available {{ openshift_service_type}} version
  11. repoquery:
  12. name: "{{ openshift_service_type}}"
  13. ignore_excluders: true
  14. register: rpm_results
  15. - fail:
  16. msg: "Package {{ openshift_service_type}} not found"
  17. when: not rpm_results.results.package_found
  18. - set_fact:
  19. openshift_version: "{{ rpm_results.results.versions.available_versions.0 | default('0.0', True) }}"
  20. when:
  21. - openshift_version is not defined